home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 44
/
Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso
/
Aminet
/
game
/
2play
/
ChaosHeavy.lha
/
Chaos
/
History1997-1999.txt
< prev
next >
Wrap
Text File
|
2001-02-21
|
471KB
|
10,271 lines
Massive Changes made by James Conwell.
Begin Version 1.6 Jan. 6th 1997
*Enhanced Pronuciation of Speech.
*Made numerous enhancements to program documentation.
*Made numerous enhancements to the User Manual.
My dad told me that he was playing a game of Chaos 1.5 and he had a magic
bow with Range Boost. Everything was great. He then got _another_ magic
bow so he thought "Oh cool! Now I can be even more powerful!" He cast
magic bow and it removed his Range Boost! He was not happy.
One thing that has always annoyed me is not knowing if I have line of sight
diagonally adjacent to a generator or wall. I hate it when I try to cast a
creature into a blank spot by a generator and then it says I can't because
I don't have line of sight! Sometimes it works, sometimes it doesn't. It
all depends on the quadrant.
I have decided to alleviate this and add a new capability at the same time.
Spells now have a CAST_LOS bit.
Here is a complete list of things that I have changed in the cast.tex so
far:
*1. Added a new bit to CastInfo[] called CAST_LOS. This bit determines if
a spell needs Line Of Sight or not. This solves the problem of casting
creatures diagonally next to a generator or other large square object.
It also allows the creation of spells that, for instance, have a range
3 but DON'T require line of sight. Cool!
*2. I have modified the spell bits appropriately. Now all spells have thier
CAST_LOS bit set except for spells with range of 0,1 or 15. So everything
is functionally the same as it was.
*3. CastInfo[] is now an array of UWORDS instead of UBYTES.
*4. Made 1 change to DoCast and 2 changes to DoComputerCast to make the
new CAST_LOS bit take effect.
*5. Vengeance and Exorcise used to do the {\it exact} same thing.
So I was going to change Exorcise to only be able to be cast on Undeads
and bump the strength up to 7 to make up for this but there is no
CAST_UNDEAD or CAST_UNDEAD_ONLY bit so I just raised the strength of
Exorcise to 4.
I just don't see the point in having 2 spells which do the exact same
thing.
Dark Power and Justice used to do the exact same thing. Now I have
changed Justice to be 2 sets of 3-point attacks instead of 3 sets of
2-point attacks to add some variety.
Thus Justice is now a bit less useful but Exorcise is a bit more useful
so hopefully the play-balance is roughly the same as it was.
*6. Magic Bow is now cumulative. Since magic bows are so rare (I've never
had 2 of them in Chaos 1.5), I have set it to bump up the range by 1 on
additional bows. That should be a pleasant surprise to anyone if they
ever have 2 of them!
*7. Destroy Wall now destroys PowerWalls also.
*8. Made some adjustments to the TeX stuff.
*9. Show numbers beside bar graphs.
More Chaos User Manual Changes:
*I made lots of little corrections.
Then I did some embellishments:
*1. I completely rewrote the intro. Hope you don't mind.
Sorry it took so long but I just kept rereading it and editing it and
rereading it and editing it... at least 30 times...
*2. I embellished the description of the Roper, the combat section and the
impurities.
Subject: Freaky bug detected!
I read over prog.tex thinking I was just going to word correct and spell
correct the tex docs. This I did. They are now much better.
Then I noticed something...
#define GAMEROWNTSC 14 /* number of rows in a NTSC game */
#define GAMEROWPAL 11 /* the number of rows in a PAL game */
These 2 numbers are switched around!
PAL is higher resolution than NTSC, thus it has more rows.
PAL lores = 320x256. NTSC lores = 320x200.
I couldn't believe that the game could even work with these 2 numbers switched
around so I did some more research and found out why it was working...
Another bug!
Look at this from cmove.tex
int weights[GAMEROWNTSC * GAMECOL];
See, it is using what is supposed to be the small value which would be too
small for PAL users which would mean you would be using out-of-bounds
subscripts in PAL mode BUT since you are the luckiest programmer I've ever
seen, these 2 bugs cancelled each other out! Unbelievable! When *I* have
2 bugs in a program they produce 4 errors, not 0.
I fixed the stuff in prog.tex and cmove.tex
Also in cmove.tex:
I fixed the deal where Independent Undeads never bothered to shoot.
Word corrected some tex notes.
I noticed something else that looks highly suspicious in prog.tex:
#define NTSCMode (GfxBase->DisplayFlags & PAL)
Shouldn't this be NTSC ?
Yes.
I will soon be adding a bunch of new stuff to the game and I don't want to
be accused of being a memory hog so I have made 2 changes in prog.tex to
save about 3k of ram. I changed
const char creature_name[][CREATURE_SIZE] = {
to
const char *creature_name[] = {
to produce a ragged array instead of a memory wasting rectangular array.
Ditto for creature_speech.
This has saved several k of ram!
This also allowed me to delete the #define CREATURE_SIZE and SPEECH_SIZE
since no part of the program ever uses either one.
move.tex
On a completely seperate subject, I made a small change to move.tex to
allow me to see the _actual_ movement points available. Sometimes if you
have 2 movement points, you can move diagaonally and then straight. Other
times you can move diagonally once and then your move is over. I am hoping
that I can understand the movement system better with the real movement
points showing. I already understand it better now that I know that you
are given a free .5 points at the beginning of the turn. That helps a lot,
but I still don't get some things.
*Added some prototypes to eliminate warnings with SASC6.0
*Show LOS required on Spell Info screen.
Regarding using bitfields vs. NOT using bitfields:
Well, here is everything I know about the subject:
accessing board[i].char_stat.Life as a field of 5 bits vs. as a byte.
I will ignore the C overhead since I don't know precisely what that is.
At some point a move instruction will be generated to get the value then
an and instruction will have to done to mask the appropriate bits. Given
the notorious inefficiency of C, probably wastes an instruction fetching
the mask, but who knows.
bitfield method:
move.b source, d0
move.b mask,d1
and.b d1,d0
lsr.b #x,d0
Byte method:
move.b source,d0
So here we have 4 instructions to fetch the value vs. 1 instruction. Even
if C is perfectly efficient, it WILL take at least twice as many instructions
to fetch a bitfield as opposed to a byte.
As for board[i].char_stat.Life vs. board[i].Life I would guess that the
shorter version is quicker but the compiler could be clever enough that it
wouldn't matter. I am assuming that both are bytes or both are bitfields.
The reason bitfields are inherently slow is that all processors that I have
ever studied are all designed to handle data in bytes, and/or words and/or
longwords. Most processors have no bitfield instructions. Most of the
processors that do have bitfield instructions (such 68020 to 68060) the
bitfield instructions are much slower than a simple byte instruction (about
4x slower) It is often faster to avoid the bitfield instruction and just
use a byte instruction and an and/or instruction.
If you are really worried about speed then there is one simple thing you
can do in the future to speed things up. Avoid >> and <<. Shifting a
variable takes an extra instruction. So shifting and storing takes twice
as long as just storing.
However, it is even worse on the 68000. On the 68000 a shift of 1 takes as
long as a regular instruction but it takes another 2 cycles for each
additional shift. So when you shift by 3 ( << 3 ) you are adding around
the equivalent of 2 simple instructions to the overall execution time in
assembly code. Quite possibly more in C.
The 68020 and higher processors have a "barrell shifter" which means they
can shift any number of bits left or right in the same amount of time as a
shift of 1.
The only time I've really noticed chaos being slow is during computer
movement on my Dad's 7.15909 Mhz A500. I noticed a lot of math being done
in cmove.tex so that probably explains it. Multiplies take about 70 cycles
and divides take about 158 cycles on the 68000. That's like 20 regular
instructions.
It basically seems ok to me on my A3000 and back when I used to play it on
the A4000 it flew.
Oh yes, I forgot one thing:
Every time you access a bitfield it _must_ take at least TWO extra
instructions to do that. Each instruction is 2 bytes. So if you have lots
of code that accesses bitpacked fields then much or even all or even worse
than all the space saved is wasted again.
So right now every time we access char_stat.Life, there are 2 extra
instructions being generated (at least). So if we access char_stat.Life 100
times in the program then that wastes 400 bytes and we only saved 3 bits
per item in creature info. So if we have 200 objects (there aren't that
many yet but there will be one day) then we saved 200*3 bits = 600 bits =
about 75 bytes. A net defecit of 325 bytes.
And it takes significantly more time; executing 3 instructions instead of
1.
Chaos is currently 190284 bytes in size.
To prove that I know what I am talking about, I will now change
CreatureInfo to use all BYTES and then do a complete recompile.
<Time Passes>
...
<More Time Passes>
Ok the complete recompile is done.
Chaos is now only 187452 bytes in size! Cool, I just saved you another
2,832 bytes. Maximum code size was reduced by about the same amount.
The game is now faster too. Our fathers should appreciate that. 8)
This is good because I'm fixing to add in about 5k of new
variables to the program. Heehee.
James "The Optimizer" Strikes Again!
SAI changes: =========================
*20 new spells!!!.
*CAST_UNDEAD_FLAG
*Other stuff.
*Fixed a bug that sometimes causes a crash. (obtain/release semaphore)
*Added some prototypes to eliminate warnings with SASC6.0
======================================
More JJC Changes
Begin Version 1.7 Feb 16th, 1997.
*Resurrect and RessurrectID -> MassResurrect
*Cloaked creatures now block enemy's LOS but not friendly's LOS.
*No need to specially program things that don't block LOS (like Pool and
Fire). The Chaos Engine now takes care of that for you when you set the
Blocks_LOS entry in CreatureInfo appropriately.
*Added new function SameTeam to predicate.tex to assist with new LOS code.
*Pick your bonus spells. I'll do the GUI later.
*Fixed life 0. Creatures didn't die when they reached 0 life. Now they do.
*Fixed Load last name from savefile.
*Added lots of new stats in and set them appropriately for each creature.
*Movement points as float rather than integer.
*Personalities (I put in the new stats in CreatureInfo but cmove.tex still
must be changed.
*Modified end-of-turn healing to heal all appropriate stats.
*Modified existing combat routine to take into account negative combat.
We can now make creatures whose attacks heal instead of hurt.
*Modified existing combat routine to take into account affecting
different/multiple stats other than life.
Now we can make creatures that attack any stat or combination of stats.
Such as intelligence or magic resistance etc.
*Added 1 new paragraph to the docs.
*Put in SpecialCombatHandler Routine which replaces WaspNestHandler
*Roper, Wasp Nest, Pool, Volcano, Apple Tree are now ordinary items which
have SpecialCombat.
*New predicate isSomethingThere(cell)
*Modified RangedCombat routine to take into account CR_LOS. Now we can
make creatures which have distance weapons that don't require line of
sight.
*Added new predicates: AttacksLiving, AttacksUndead, isUndead
*Modified maiming routine to not maim on negative combat.
*Fixed Predicate.tex with modified predicates to use the new char_stat.Stat
method.
*Completely absorbed SpecialFlags into char_stat.Stat.
*We can now have creatures that gain or lose flying ability.
*UNDEADFLAG has now been translocated into char_stat.Stat with UNDEAD_STAT
* A. Lich and Lich Lord and Raise Dead have been modified appropriately.
* B. search/replace all UNDEADFLAG, #define UNDEADFLAG. Done.
C. Decide what to do about slime covering you over. I guess just have
oldchar_stat
* C. There was a bug with Magic Sword and Magic Knife: If the wizard
already had MAX_COMBAT and then cast Magic Sword or Magic Knife then
he did NOT gain the abiltiy to attack undeads because the sword/knife
did not get applied. This is now fixed. The routine is now much
shorter also.
* D. Magic Sword and Magic Bow and Magic Knife now set the appropriate
bit in board[cell].char_stat.Stat
* We can now make creatures which cannot attack living creatures, only
undeads.
* We can now make creatures whose specialcombat affects very specific
groups of creatures and any combination of stats.
* Info Screen graphing is now even better!
*I have Considered making Stat an int to eliminate many warnings
but I have decided that it would be much better to just change the
functions that generate the warnings into macros. This results in a
faster game. A small macro should be slightly smaller than a function call.
The macro saves 4 bytes by not using bsr/rts and I guess it saves about 8
more bytes because of not pushing and pulling the parameters on/from the
stack like a function does. But it should use more bytes by having in-line
code. All in all it should save a few bytes per macro, as long as the
macros are simple 1-line commands.
I am certain that macros are faster.
* Experiment: Change the following functions into macros and recompile to
measure the code size difference:
isStatic, isMount, isDragon, isGrowth, isInanimate and isMeditation.
isFlying could be converted to a macro but that would require that
WizardWings set the flying bit on the wizard rather than setting the
.Wings bit in the wizard structure. Why not have WizardWings simply set
both bits for now?
Chaos is currently 194476 bytes.
Recompiling...
Chaos is now 194028 bytes. I saved us another 448 bytes! And that
is just for now. The more we use the
macros in the future, the more we save!
The game is now somewhat faster.
*ShadowForm, .Shadow, ShadowFormID -> Irvine's_Invulnerability
*Heal and HealID -> Restoration.
*Modifified Sencode.c so we can now have spellnames with ' in them.
* info screen has now been revamped to show all the new stats in a graphical
manner.
*DELETE UNDEADFLAG AND isLivingAttackingUndead from the program forever!
*Edited the tex in spell.tex
Begin version 1.7.2:
*Replaced all occurences of board[cell].??? & CLOAKEDMASK with isCloaked
macro. (except 1)
*Translated all the code so the Cloaked Stat now resides in char_stat.Stat
* Replaced all ((board[i].flag & ANIM_STATE_MASK) != DEAD) with
(!isDead(i)) macro
* Translated all the code so that Dead Stat now resides in char_stat.Stat
*Sleeping Creatures now stop being animated so you can see that they are
asleep.
C SUX! C SUX! I just wasted the last hour trying to figure out why the
hell this program wouldn't compile. It turned out that it WASN'T doing
predicate.tex even though I had saved it TWICE and reloaded it to make sure
that everything was there. It just ignored my changes and kept using an
old version that was somehow missing a ).
Transfer over the other flags like cloaked, dead, asleep, static.
I was going to transfer over asleep and static but static should never
change so hopefully I can ignore that. That leaves asleep... I'm not sure
if I should have asleep in both cell.flag and char_stat.Stat for now or
what. 1st I will simply replace all:
((board[i].flag & PLAYER_MASK) >> 3 != ASLEEP) )
with !(isAsleep(i)) to make things easier to read, etc.
I was really cautious with transferring over ASLEEP. Perhaps when I know
the program better I will make things more elegant and simple.
* Translating dead and cloaked into char_stat.Stat is turning out to be a
real bitch. Probably something will be messed up somewhere.
Hmmm.. Everything seems to be working perfectly except for the fact that
Computer controlled shooters keep shooting dead bodies. Perhaps I forgot
a ! somewhere? Hmmm... the computer controlled shooting looks ok and so
does the macro. Strange. I don't know what is wrong.
Cloaking isn't working. 2 point attacks damage. Cloak graphic not drawn
on screen. Ok I think I fixed everything. Dead, cloaked, asleep, static
will reside in both board[cell].flag for the animator and
board[cell].char_stat.Stat for everything else.
Part of the reason I want to have dead and asleep in char_stat.Stat is so
that we can eventually have sleeping and dead creatures that belong to
someone. That would allow us to make more wierd spells that only affect
your own or your enemy's dead creatures, etc.
* I spent all day reading the SASC manual about smake and codeprobe.
* Enhanced the smakefile
* Used codeprobe to figure out that screwey bug with dead creatures. Now
everything works perfectly!
Weird bug with simulacrumming a wizard.
I was controlling 2 different wizards who were not in an alliance with each
other. I had Double in effect. I double simulacrummed the other wizard.
I simulacrummed the original and then I simulacrummed the copy.
I hopped one of the wizards on a unicorn and it just disappeared. It wasn't
there and it couldn't dismount. Ever. The unicorn was still there but not
the wizard.
The following 3 things were psychologically torturing me:
*1. WriteBottom always wrote text off the bottom of the screen
*2. All the -1's for accessing the Team[] array
3. All the -1's for accessing the wizards[] array
Now I will attempt to eliminate all these -1's from the program. I sure
hope this works because it is very confusing to me, trying to tell which to
use, player or player-1. 1st I will attempt to convert Team[] since there
are only about 19 occurrences of Team[] to convert.
Chaos is currently 197156 bytes.
Well, that wasn't much fun at all. I ended up having to add some +1's to
the program due to the way loops and variables were pre setup so it
cancelled out a bunch of the advantage I was trying to get.
Chaos is now 197136
*Team[] now goes from 0 to 8. 0 is not used but is saved and loaded.
Now we just check Team[player] instead of Team[player-1]
I think I will just pass on the wizards array, though I really wish it was
based on 1 to 8 to match the wizard #. Too much of a chance of me
introducing a new bug that I can't fix.
*Modified the following creatures to take advantage of the new combat system
*1. Cobra is now poisonous.
*2. Halfling is now _very_ magic resistant.
*3. Mind Flayer now really attacks intelligence.
*Creature Recovery now handles negative recovery rates (Poison), though it
won't actually kill you yet.
*Fixed description of Justice spell.
*Numeric keys show player's creatures in RED1 if they have moved and in
WHITE if they haven't moved.
My upgrade was going along just fine until I tried to move the dead bit
into char_stat.stat. Now I actually made bugs. Hopefully they are all
fixed now.
* Fixed Lich spell description.
* Pool is now a regular spell. In my opinion it is hard enough to use due
to Eagles and things that fly up at it and also because it adds the
"Repair your forces" play mechanic to the game.
BUG: LoadGame no longer works.
Begin 1.7.3
*Made 2nd info screen to show all stats such as CR_LOS, Attacks_Undead,
Favorite Food, Afraid of, etc.
This is something that I've been wanting for a very long time! Now I can
see EVERYTHING about a creature.
*Made 2nd SpellInfo screen with all casting attributes. This is something
that I have _REALLY_ been wanting for a long time! I am always casting a
spell and then I find out that I can't cast it where I want to so I have
to abort it! I have 3 times tried to cast armour on a Violet Fungi during
an important game and it wouldn't let me.
*Give the archers actual archery skill. Reduce their range to keep the same
play balance as before.
*Give the archers 1 point of Magic Resistance recovery since their
description says they have a pure heart and have high magic resistance
*Removed archery skill from inanimates and growths.
Replace GetCell(x,y) with an array.
Make Getx(cell) Gety(Cell) with an array to replace all that division and stuff.
Would GetCell really be faster? Hmmm... I suppose not.
Would Getx(cell) and Gety(cell) be faster?
I think so. Since now each one uses a division instruction but accessing
a 1-dimensional array requires no multiplication or division, just 1
addition to add the subscript to the base. This will be MUCH faster on the
A500. Unfortunately, I have just looked around through the code and it
doesn't seem that it gets used all that much. I'll have to use an int to
prevent warnings so the question is will it be worth the 1k of ram that it
will use?
*Earthquake movescreen effect.
* Horziontal_Shake
* Vertical_Shake
* Diagonal_Shake
*Changed Move.tex so that elementals, generators, Stone Giants
and StoneGolems and EarthQuakes shake the screen when they die.
*When an EarthQuake grows, the screen shakes.
*Speeded up screen scrolling in start.tex. At first this made it smoother
but now it is yucky. It is rather random.
Show team on info screen. Need Sean to redo near/far hunks or something.
Show corpse (if any) on info screen somewhere.
*Fixed bug with identification of bonus spells on spellinfo. Another one of
those -1 things threw me off.
*Show Powerups like combat, recoverboost and speed on info screen. I've been
wanting this feature for a long time! I am always having 3 creatures that
look alike EXCEPT for that 1 of them has Combat. And then I have to click
on each 1 of them and look down at the combat stat to find which one it is.
Now the little Combat symbol is up there as a powerup so it is easier to
spot. Looks cool too.
*Eliminated Plastic looking borders on info screens. Now looks more
slick!
* CR_LOS is now more sensibly known as Archery in the program.
Some sort of bug with scrolling credits. After 20 minutes or so the
machine locks up.
* Changed it so that creatures without ranged combat no longer have a
CombatApply mask on life for ranged combat.
* Adjusted Magic Bow and Magic Wings so they would work 100% with the new
system.
Begin 1.7.4
*Set ATTACKSLIVING_STAT and ATTACKSUNDEAD_STAT for lichlord and
Magic sword/knife/bow. (move.tex/cast.tex)
*"fixed" LichLord, Simulacrum, Replicate, Vortex.
* Show allies on number keys. + change the docs.
* Allegedly fixed it so a wizard in a castle or tree can attack enemies.
* Joe made me put in numeric keypad support.
* put in new stat in cast.tex called CAST_GROWTH because the computer just
cast 6 raise deads on 6 different orange jellies.
* Things like walls and pits can now be cast ON growths.
Begin 1.7.5
* Fixed that annoying empty dead cell bug.
* Fixed Tempests so they don't distort space.
Sometimes the Bonus Spell window ONLY displays Hide spells. Once this
starts it never seems to stop; every bonus spell for the rest of the game
is displayed as a Hide spell.
* New method of showing what stats are attacked by combat.
* Optimize the highlight routine.
* The highlight routine is tooo slow so I am implementing xpixel[cell] and
ypixel[cell] which will save 2 divisions and 2 multiplications and 2
additions per relevant cell. Highlighting a screen full of creatures,
growths and allies was just tooo slow.
* Purple combat conflicted with pink recovery so I changed Combat to BROWN.
* Growth rates were incredibly high so I doubled GCEILING to slow them down
some.
* Fixed the DarkWood so they now attack and while I was at it I changed
their abilities and description a bit.
* RMB now cancels info screens properly.
* Shortened ScreenShakes.
* Fixed Touch of God to set CombatApply Combat and Ranged Combat for Life.
* Now Info screen shows BrainBoost, MagicShield and Armour powerups.
* Team Icon now displayed on Score Screen and TeamScore screen.
* Collapsing meditations now give at least 2 spells to pick from.
Test 8 human players with 20 spells.
Vitality Icon -Speed icon Command Icon. I vote .5 points for. Joe votes 1
point against Joe wins.
* Team scores are now displayed but they are not sorted correctly.
BUG:
Start a game with 8 human players and 20 spells each.
If you cast and discard then everything is ok. If you don't cast but you
do discard then everything is ok. But if you cast and then don't discard,
the next player loses a spell (only starts with 19).
* Pick your bonus spell even if it is only 1. This way you _know_ that you
got a bonus spell and you know exactly what you got as a bonus spell.
* The old sound system hogs 2 audio channels. As a quick fix I just
commented out the code for 1 of the channels so now it only uses/hogs 1
channel.
----------- LONG HIATUS ----------
Begin vesion 1.8:
* July 1997: Made a teensy weensy correction to the docs.
* Outlined some further ideas on gameplay in English.
* fixed some serious problems in the makefile. I had added some new
functions into cell.tex and then called them from prog.tex but the game
wouldn't compile because it kept complaining that there were no prototypes
declared for the functions (but they were declared properly in cell.tex).
The trouble was the makefile was trying to recompile chaos without FIRST
recompiling cell.tex. cell.o wasn't listed as a dependency. Now it is.
Same thing with start.o.
Presumably just about EVERY file should be listed as a dependency for
Chaos. And probably MANY files should be dependencies of many other
files... There must be a JILLION other bugs just waiting to happen in the
makefile.
Ok, now cell gets redone EVERY time I do anything. I just made one little
change to start.tex and now cell.tex AND start.tex and spell.tex and
cast.tex and info.tex, cmove.tex, move.tex, score.tex, warp.tex are ALL
being recompiled!! 8(
Ok, I just waited half an hour for my program to compile before I noticed
that tex2c was caught in an infinite loop and was making an infinitely
large sized cell.c file. (There was no \end{verbatim} at the very end of
cell.tex
* Added the following color effects to cell.tex:
* The FadeTo___Scale routines fade the foreground only. The background stays
* black.
* FadeToGreyScale (Fade the whole screen to a b&w photograph)
* FadeToRedScale
* FadeToGreenScale
* FadeToBlueScale
* FadeToCyanScale
* FadeToYellowScale
* FadeToMagentaScale
* FadeToColor (Fade the whole screen, including the background, to a SOLID color)
* LowLevelFade (fades to any colorscale)
* Added new global variable vp to be the pointer to the viewport of the game.
I needed this for my asm animator routine.
* Replaced all occurences of &(screen->ViewPort) with vp thus saving a few
bytes and cycles.
Problem: You click on a creature and then you think about where to move
him. Where is he most needed? Which direction should he move? Should he
attack the weak creature or the strong one? Who's creature is that over
there anyway? .... So you highlight the ? mark and you look around at all
the different creatures and one thing leads to another and pretty soon...
You've forgotten which creature you were moving! I've noticed this
happening on a regular basis with people who are playing a big complicated
game. Sometimes the phone ringing can cause this same problem.
Solution:
* Added animated sprite to highlight the creature whose turn it is.
Utilizes 50 fps animation so it really catches your eye. I drew a simple
little 4-frame animated sprited for this purpose. Hmmm... 50 fps is
actually TOO fast (at least for this particular sprite) so I slowed it
down to 25 fps.
* Successfully linked an asm routine to the C main program and shared
variables between C and asm. Gee, it only took me 20 hours of mortal
combat with the Slinker to achieve this... I eventually just set
data=far for EVERY module to get it to work right. I'll fix it to
use near data later.
* Modified the makefile to take into account the new asm files. BTW: the
compiling/linking process seems to go quite fast when I just make a little
change to move.tex or cmove.tex. The makefile seems to really be doing
its job now. 8)
* Replaced all occurences of
(cell % GAMECOL) * 16 + 8; and (cell / GAMECOL) * 16 + 8; and
((cell % GAMECOL) << 4) + 8 and ((cell / GAMECOL) << 4) + 8) WITH:
xpixel[cell] and ypixel[cell]
* Many small fixes to TeXnotes.
BTW: My brain had begun thinking in C and I had planned to simply make my
sprite-highlighter routine and my animator routine in carefully coded C. I
decided I'd do it in C and then MAYBE way later on convert the whole thing
to asm. So I wrote up my sprite-animator in C and then it wouldn't compile
my 0b1000000000000001 numbers. I asked numerous people on the net and they
all said "C can't do binary numbers" (!) WTF!? So I got REALLY mad at
how lame C is because I like to SEE my and/or/xor masks visually in my
program. In fact I got so mad that I just rewrote the whole thing in asm
and now I'm glad I did. But don't worry, when we convert to another
computer I can translate all the asm code to C no problemo amigo. 8)
My sprite was in binary numbers because I designed it in Cygnus Ed
Professional as a series of binary numbers.
* Animation Upgrade Plan:
* Phase I: Shifted the map over to the left edge of the screen so all
graphic writes are now word aligned. The Blitter is a 16-bit processor.
The old system had the blitter doing the following things:
1) Read Source data of 1 word.
2) Read *2* destination words. (since they were unaligned)
3) Shift the source data over and mix it with the destination data and
then write out the *2* destination words.
That is a total of 5 Bus accesses!
Now that I have word aligned everything the blitter just does:
1) Read Source data of 1 word.
2) Write destination data of 1 word.
Only 2 bus accesses!! So the blitter operations are now more than 2.5x
as fast! Unfortunately after factoring in CPU overhead it may work out
to only about 2x as fast.
This was also neccessary for my upcoming assembly animator which will get
even more speed as a result of the even alignment.
You can still tell where the edge of the map is because the
mouse pointer stops at the edge. If that isn't good enough then just
tell me and I can make a 1-pixel-wide sprite that marks the edge.
I left you a 1-pixel edge on the top of the map. 8)
* Phase II: Static and empty cells are NO LONGER REDRAWN by the animator.
If it isn't animated then the animator doesn't need to draw it. So on
average this doubles the speed of the animator. In the WORST case it
will go the same speed as it used to go. In the BEST case it goes about
238x faster! On average it should cruise 2x as fast as before.
In order for phase II to work, all cell effects routines that damage the
graphics of multiple cells are now modified to set RedrawAll=YES so the
animator will redraw all objects during the next cycle. RedrawAll is a
bit misleading since it doesn't redraw empty cells at this time.
(Currently the game is so well-behaved that it doesn't need empty cells
to be redrawn.)
I have implemented much of Phase II at this time but I have to send you
an update in 36 hours so I am putting it ON HOLD due to the fact that
updating cast.tex may be troublesome... I just don't know yet. This new
animation philosophy means that when the game modifies the graphics in a
cell then it should set them back to way they are supposed to be at the
end of the routine. Routines cannot depend on the animator to redraw an
inanimate object. Some routines in the game are set to work fine with
this new philosophy, other routines are ???
* Doubled the speed of the BoardEffect C code.
* Retargetable graphics upgrade: Retargetable graphics are needed so the
game can inherently work with 16x16 or 32x32 or 32x16 or 16x32 or even
64x64 cells. This is needed for a variety of reasons and since my
xpixel[] and ypixel[] arrays have already done much of the work I may as
well just make the rest of the changes that are needed to complete this
new capability:
* Replaced all appropriate occurrences of 16 with CellWidth or CellHeight
and 8 with HalfCellWidth or HalfCellHeight in Cell.tex, move.tex,
cmove.tex and prog.tex and cast.tex. I didn't touch info.tex.
I'll have to do that one when the day comes.
You should look over TELEPORTIN and TELEPORTOUT in Cell.tex because I
think they need further adjustment to make them handle any size of cell.
In the future don't use the constant 16. Use CellWidth or CellHeight
instead. Don't use 8. Use HalfCellWidth or HalfCellHeight instead.
CellWidth, CellHeight, HalfCellWidth and HalfCellHeight are variables and
not #defined because we may someday have the capability of letting the
user choose his displaymode and his tilesize at run time.
* I talked to an Amiga guy about his favorite strategy games. (He had no
idea that I was co-coder of Chaos) He mentioned Chaos as one of his
favorite strategy games. I asked him lots of questions about Chaos like
what are its good points and what are its bad points and what kind of
game is it? And stuff like that. He said a lot of interesting things.
One of his main complaints was that the computer moved to slowly. Well,
I had just been waiting for a real life gamer to complain about the speed
to justify spending some time looking over cmove.tex. Now that I've
looked it over Here is my report:
* Speeded up GetWizardWeight
* Speeded up ChooseDestination
* I just figured out how to speed up computer movement an additional 4x
but I doubt that I can get it programmed in before the Sunday Morning
deadline.
* I just spent 10 hours fiddling with slinker settings and recompiling and
adjusting code and moving data into __far and reading manuals but nothing
worked! I could NOT get Chaos back to using near/far data again. So I am
giving up in frustration and I will try again in a few months when I know
more. In the meantime, the makefile is already set to do data=far on
every module so at least the game works.
* I can't think of any reason not to be passing parameters in registers.
This is faster and takes less memory. So I will now modifiy the makefile
to do parameters=register. This should save us about 3k off the size of
the executable. Chaos release is currently 235328 bytes
<Several hours later> Geez... it kept giving errors about undefined
symbols and stuff.... Ok I FINALLY got it all figured out and it is
compiling properly. Chaos is now 231892 bytes for a savings of 3436
bytes! That works out to about 512 bytes per hour of work....
* I've now read the docs about saveds and I understand it now. I can't
think of any reason why we need to compile the whole game with saveds.
Only the Animator Task needs __saveds in its definition (which it has had
for some time now.) So I will now remove saveds from the makefile and
save about another 1k. IF YOU KNOW OF ANY OTHER FUNCTIONS THAT NEED
__saveds THEN PLEASE JUST ADD THE __saveds keyword to their definition
and also tell me about the function so I'll know about it. Thank you. 8)
* Chaos is now only 229696 bytes thus saving 2196 bytes!!!!
I assume we can save another 20k once we figure out how to start using near
data again.
--------- SUNDAY DEADLINE HERE --- COULD NOT REACH YOU ---------
* All this time my HighlightSprite was messed up and nobody ever noticed
it. But when I stared at it I noticed that the right hand side was
messed up somehow. It turned out that the right side of frame 3 was
exactly the opposite of how it was supposed to be. FIXED.
* I just found this: ftp.waikato.ac.nz Maybe we could FTP in the future?
Then I wouldn't have to do that weird compress or whatever.
* I rewrote SqDistance in optimized assembly code. It is now 11x as fast
as before. C version took about 1834 cycles while mine takes only about
156 cycles. Cycle times listed are for 68000. I am hoping this will
translate into making the computer creatures move 4x as fast because
SqDistance is in the inner-innerloop and gets executed a LOT.
* Ok, I've gone all through cast.tex and made the changes to keep it
in sync with the new animation system. CellEffect does not redraw the
cell at the end so the caller must redraw it if needed. (It usually is
but not always.)
* ReDrawCell now explicity redraws BLANK cells as BLANK cells. So now it
will erase any damaged graphics. It also does its work within an
Obtain/Release Semaphore pair.
* I was wandering through the program, implementing Phase II of the new
animation system when I found the following messed up code.
Check it out: .... 30 minutes later... oops... I thought I'd found a
major bug. But it turns out to just be messed up indentation. I made
the necessary adjustments.
Collapse magic castles, dark citadels and magic woods as appropriate.
\begin{verbatim}
if (((id == MagicCastleID || id == DarkCitadelID) &&
(MSGRandom() % CASTLE_COLLAPSE) == 1) || (id == MagicWoodID &&
GetWizardCode(i) != NOTHING && (MSGRandom() % TREE_COLLAPSE == 1))) {
int player;
player = GetWizardCode (i) - 1;
ObtainSemaphore (&BoardLock);
board[i].id = NOTHING;
ReleaseSemaphore (&BoardLock);
CellEffect (i, EXPLODE);
ObtainSemaphore (&BoardLock);
if (player >= 0) {
board[i].id = wizards[player].id;
board[i].flag = wizards[player].flag;
board[i].char_stat = wizards[player].char_stat;}
else {
board[i].id = 0;
board[i].flag = 0;
board[i].char_stat = InitialData[NOTHING];}
DrawCell (&NothingImage, i);
ReleaseSemaphore (&BoardLock);
board[i].oldid = NOTHING;
board[i].oldflag = NOTHING;
board[i].oldchar_stat=InitialData[NOTHING];
if (isWizard(i)) {
sprintf (text_store,"New spell for %s", player_name[player+1]);
WriteBottom (rastPort, text_store);
AUDIOPlay (1000,10,1,20);
wizards[player].BonusSpells += 1;
wizards[player].BonusSpellsPick = 2 + MSGRandom() % 3;}
}
}
}
* I have changed the animator to do only _1_ Obtain/Release Semaphore pair
per update. This saves 474 jsr/rts combos per frame resulting in a
significant speed increase in the animator task.
I traced through ObtainSemaphore and ReleaseSemaphore and counted the
cycles. All cycle times are from the 68000.
ObtainSemaphore Trace:
12 LEA 07583670,A0
20 MOVEA.L 0004,A6
18 JSR FDCC(A6)
12 JMP 0XF82E50
16 ADDQ.B #1,0127(A6)
16 ADDQ.W #1,002C(A0)
8 BNE.B 0XF82E68
28 MOVE.L 0114(A6),0028(A0)
16 ADDQ.W #1,000E(A0)
10 BRA.W 0XF82954
16 SUBQ.B #1,0127(A6)
8 BGE.B 0XF82966
12 TST.B 0126(A6)
8 BGE.B 0XF82966
12 TST.W 0124(A6)
8 BMI.B 0XF82968
16 RTS
TOTAL:
236 CYCLES! *238*3=168504 cycles for a screen full of animated objects at
a VERY low framerate of only 3 fps.
ReleaseSemaphore Trace:
12 LEA 07583670,A0
20 MOVEA.L 0004,A6
18 JSR FDC6(A6)
12 JMP 0XF82EA6
16 ADDQ.B #1,0127(A6)
16 SUBQ.W #1,000E(A0)
8 BNE.B 0XF82EBE
20 CLR.L 0028(A0)
16 SUBQ.W #1,002C(A0
8 BGE.B 0XF82EE0
56 MOVEM.L D0-D1/A0-A3,-(A7)
4 MOVEA.L A0,A2
8 LEA 0010(A2),A0
12 MOVEA.L (A0),A1
12 MOVE.L (A1),D0
8 BEQ.B 0XF82F18
12 MOVE.L D0,(A0)
6 EXG D0,A1
16 MOVE.L A0,0004(A1)
4 MOVEA.L D0,A1
16 MOVE.L 0008(A1),D0
14 BCLR #0000,D0
8 BNE.B 0XF82F70
4 TST.L D0
8 BEQ.B 0XF82F20
4 MOVEA.L D0,A1
16 MOVE.L A1,0028(A2)
16 ADDQ.W #1,000E(A2)
4 MOVEQ #10,D0
18 JSR FEBC(A6) ------------->
12 JMP F82826
8 LEA 001A(A1),A0
20 MOVE.W #4000,00DFF09A
16 ADDQ.B #1,0126(A6)
20 MOVE.L (A0),-(A7)
20 OR.L D0,(A0)
16 MOVE.L 001E(A1),D1
6 AND.L D0,D1
8 BNE.B 0XF82886
16 CMPI.B #04,000F(A1)
8 BNE.B 0XF82896
14 AND.L 0016(A1),D0
8 BEQ.B 0XF82896
4 MOVE.L A1,D0
12 MOVEA.L (A1)+,A0
12 MOVEA.L (A1),A1
12 MOVE.L A0,(A1)
16 MOVE.L A1,0004(A0)
4 MOVEA.L D0,A1
16 MOVE.B #03,000F(A1)
8 LEA 0196(A6),A0
18 BSR.W 0XF819E6 -------->
12 MOVE.B 0009(A1),D1
12 MOVE.L (A0),D0
4 MOVEA.L D0,A0
8 BEQ.B 0XF819F8
16 MOVE.L 0004(A0),D0
16 MOVE.L A1,0004(A0)
12 MOVE.L A0,(A1)
16 MOVE.L D0,0004(A1)
4 MOVEA.L D0,A0
12 MOVE.L A1,(A0)
16 RTS ---------------------<
14 CMPA.L 0196(A6),A1
8 BNE.B 0XF82896
16 SUBQ.B #1,0126(A6)
8 BGE.B 0XF828A4
20 MOVE.W #C000,00DFF09A
12 MOVE.L (A7)+,D0
16 RTS----------------------------<
60 MOVEM.L (A7)+,D0-D1/A0-A3
10 BRA.W 0XF82954
16 SUBQ.B #1,0127(A6)
8 BGE.B 0XF82966
12 TST.B 0126(A6)
8 BGE.B 0XF82966
12 TST.W 0124(A6)
8 BMI.B 0XF82968
16 RTS
1164 TOTAL CYCLES! *238*3 = 831096 cycles!
1 Obtain/ReleaseSemaphore pair takes 1400 cycles.
Since it should only take about 1800 cycles to draw one cell this has
nearly doubled the speed of the animatortask yet again.
If the board was filled with animated objects which were being redrawn at
the very slow speed of only 3 fps then that would take 999,600 cycles per
second on the A500. That is about 14% of the total available CPU power
being constantly used just to execute Obtain/ReleaseSemaphore statements.
BUG: When you run out of spells in Texas Trash'em the game gets stuck. You
can't choose a spell or exit the spell-choosing phase. You are just stuck.
I played a test game on the 7.15909 Mhz 68000 and the computer casting of
trees was unbearably slow. Once I find the code that controls this then
I'll see about speeding it up some.
* I just noticed that the animator is still animating at full speed even
when the spell and creature information panels are being displayed.
I had noticed a long time ago that the spell info screen is filled with
text rather slowly on the 7.15909Mhz 68000 so I have adjusted the
information panels to stop the animation while they are up. This
will speed up the display of text a bit plus lighten the multitasking load
on the system while the gamer reads his spell description. BTW: This is
a good example of the clipping that the OS DrawImage routine does. It
clips the whole entire image and draws nothing when a full screen window
is up.
* Made some corrections to the TeX of msg.tex. Maybe I'll rewrite
MSGrandom in asm for a 2x or 3x speed increase. Woops, nevermind. q is
127773 which won't fit into a word. The 68000 can only divide a longword
by a word. To divide a long by a long you must use an actual math
routine so it may just as well be the C math routine. 8( However if we
ever made an 020+ version then I could easily make us an asm MSGrandom
since the 020 and up can divide a long by a long.
* New function: WaitVBlank for display synchronized waiting.
***** NEW INTRO
* Replaced old intro with "something more spectacular".
* Quadruple the resolution of the old intro.
* Same number of colors as the old intro (since the old one only used 8
colors this was not hard 8) I only used 8 colors to conserve chipram and
hopefully be able to include one of my Chaos Theme Songs along with the
intro.
* Smooth Scrolling.
* Colorfading effect.
* The text has different colors and shadows each time for variety.
* ExtraLarge, easy to read, colorized fonts.
* Quadruple-Channel music played with the rather lame, buggy and
system-unfriendly ptreplay.library.
* As far as strategy games go, the new intro-credits-presentation is fairly
good but it is still quite lame compared to Action Games and
Action/Strategy Games.
***** END NEW INTRO
OOPS! I was just about to add background music to the intro so I looked at
my filesizes: 410k, 550k, 393k, 250k. Hmmm.. The intro music may just have
to require 1 meg of chipram. Maybe the 250k one will fit. The 250k one is
the simplest sounding one though.
I also have a SPECTACULARLY GOOD LOOKING 16color super-well-textured
ColorFont that we could use in the intro but the font is about 400k so I'll
probably just use it in the "2 Megs of chipram intro".
I couldn't do anything all day saturday or sunday due to lack of
electricity.
* PROBLEM:
Games which require fonts to be copied into FONTS: have the following
drawbacks:
1. A lot of people have a FULL SYS: so there is NO room for new fonts.
2. It makes installation more difficult. Its just one more file that
someone might forget to copy.
3. When a person deletes the game from their harddrive, the stupid fonts
are still in the FONTS: cluttering up the dir.
4. I've played MANY games from aminet which required copying fonts into
FONTS: and I've played several games from aminet which required me to
copy NOTHING but the game drawer onto my harddrive. I always get a
positive feeling when I just click on the gamedrawer of the game and
drag it onto my harddrive and VOILA I am done! That is how a game
should be; easy to start up without even the TINIEST hassle.
5. There are LOTS of lamers out there who are not good at copying files
anywhere and just end up screwing things up.
6. There are LOTS of other lamers out there who just won't bother with a
game if they have to manually copy something. These people will just
never play our game. Remember, there are lots of "ordinary" people
out there who are not "into" computers like we are.
7. I find it annoying when games have to have files copied into FONTS:,
LIBS:, DEVS:, L: and S:
8. After years of using my Amiga, my HD (especially FONTS: and S:) are
cluttered up with tons of files which now serve no purpose since I
deleted the game years ago.
9. Games (and all other programs) which put config files in S: are annoying.
They should keep all their config files in their own damn directory.
10. Games (and all other programs) which edit your startup-sequence to add an
assign to their dir or subdir are HIGHLY annoying. Let's see, I paid
$400.00 for a state-of-the-art desktop publishing program with an 800k
main executable and they couldn't include a few lines of code to do their
own freaking assigns?!?!?! Or find their files on their own some
other way?!?!?!
11. I guess you are aware that programs which add assigns to your
startup-sequence are VERY common in the Amiga community. I've never
liked this because when you go to delete the program from your HD, YOU
CAN'T! You have to UNassign the assigns THEN delete the program
and/or you have to edit your startup-sequence. These are things that
a gamer person should not EVER have to do. Indeed, most gamers don't
know HOW to do such things, that's why they bought Sega Genesis and
Nintendo machines.
12. Ideally, a game should be totally self-contained. Self-contained
games are just SO easy and fun to install and play.
I haven't worked out how to make Chaos be completely self-contained and
I don't know yet if such a goal is desirable for our game but all the
problems MUST be eliminated.
* PROBLEM:
I tried to open "fonts/union.font" (so it would just load the font from
the current dir that chaos was running in) but it absolutely WOULD NOT
WORK. So I was stuck doing what most everybody else does and that is
requiring the font to reside in FONTS:
* SOLUTION:
After spending all day experimenting and talking to different programmers
and doing research, here is what I worked out:
1. The programmers all told me the same thing:
A) Ditch 1.2/1.3 and just require OS2.04+ (indeed this would have
made things MUCH easier.)
B) Under 2.04+ you can just use PROGDIR: or you can just use the
GetProgramDir function.
2. But since I want to keep Chaos playable on every Amiga for as long as
possible and since there are a lot of people who still use 1.3 I came
up with a way that will work on all amigas and OS revisions.
3. I have implemented some simple code at the beginning of CommenceChaos
to determine the currentdir and then Assign ChaosGame: to that dir.
So now we can load fonts from "ChaosGame:fonts/fontname.font" and
everything works great!
4. This nifty way of doing things will become more and more important in
the future as we utilize more fonts in the game.
5. I presume that this has also solved the problems of loading my
ChaosThemeSongs, sound effects and other things.
6. Chaos doesn't require its gamefonts to reside in FONTS:, the user
doesn't have to make any assigns and Chaos does not have to edit the
s:user-startup.
I don't know what to do about libs: I really like having libraries in my
libs: dir but Chaos requires 2 different versions of reqtools.library. It
needs one version for OS 1.3 and another version for OS2.04+. I guess
we'll just have to make an install script maybe... I'll worry about it
later.
* 2 new asm functions: pal and ntsc. To switch into either video mode
instantly on any ECS Agnus equiped Amiga. Which means _any_ Amiga
manufactured in the 1990's plus some of the Amigas from 1989 plus anybody
who upgraded their old Amigas to an ECS Agnus.
* Computer Tree Casting Speedup Plan:
* 1. Getxy(c,&x,&y) asm routine which is around 11x as fast as
x = cell % GAMECOL;
y = cell / GAMECOL;
Replaced the above code in CheckTree with Getxy(c,&x,&y);
** Referring now to DoComputerCast
* 2. Replaced 5 occurrences of isDead(i) macro with the isdead simple
variable.
* 3. REPLACED:
my = i / GAMECOL - cell / GAMECOL;
mx = i % GAMECOL - cell % GAMECOL;
if ((float)(mx * mx + my * my) >= d * d) continue;
WITH:
if ((float)SqDistance(i,cell) >= d * d) continue;
* 4. Rearranged the order of the tests to work faster for trees.
* 5. Logically avoided 5 of the if tests.
* 6. Replaced 9 occurrences of code in cast.tex with Getxy();
1 in prog.tex, 7 in cmove.tex, 8 in move.tex.
I replaced the following form of code sequences. Is this the proper usage
of the & operator in this case??? If this is wrong then please tell me.
Getxy(c,&wizards[WarpWizard[i]-1].x,&wizards[WarpWizard[i]-1].y);
// wizards[WarpWizard[i] - 1].x = c % GAMECOL;
// wizards[WarpWizard[i] - 1].y = c / GAMECOL;
* 7.11 YIPERS! GAMESPACE is not a variable. It isn't a constant either!
It is a #defined _expression_!!!!!
#define GAMESPACE (GAMEROW * GAMECOL)
GAMECOL is a constant while GAMEROW is a variable.
This means that all the zillions of loops like:
for (i = 0; i < GAMESPACE; i++)
are actually having to _evaluate_ GAMESPACE each time through the loop!
That means that the cycles of one of those complicated C multiplication
routines are being wasted each time through the loop.
This was slowing down LOTS of loops. Even the loop for the animator
uses GAMESPACE.
* Above problem FIXED and speeded up.
GetCell(x,y); in ASM!
I just looked at the C-generated ASM code for GetCell(x,y) and I could
definitely make an asm version that is about twice as fast BUT the reason
for this is simply that C is doing a full 32-bit multiply because x,y are
defined as ints instead of words. So now I must decide whether to try to
switch the entire program over to using words for x,y coords or just
writing the asm routine to take the x,y ints and use them as words.
Do you have any opinions on this?
* Test GetCell((UWORD)x,(UWORD)y); to see the code that is generated.
The Trouble is that GAMECOL is defined as an int. hmm....
Change macro to (UWORD)GAMECOL and see what happens.
OK I changed the GetCell macro to:
#define GetCell(x,y) (((UWORD)y) * (UWORD)GAMECOL + ((UWORD)x))
And the C compiler generated MUCH better code; a good 2x to 3x speed
increase. It saved a bsr/rts and *2* multiply instructions plus more!
Here is a listing of the new MUCH improved code:
| 144C 202F 0084 MOVE.L 0084(A7),D0
| 1450 2239 0000 001A-02 MOVE.L 02.0000001A,D1
| 1456 C1C1 MULS.W D1,D0
| 1458 2205 MOVE.L D5,D1
| 145A 7400 MOVEQ #00,D2
| 145C 3401 MOVE.W D1,D2
| 145E D082 ADD.L D2,D0
| 1460 2C00 MOVE.L D0,D6
Now I will test:
#define GetCell(x,y) (((UWORD)y) * (UWORD)GAMECOL + (x))
This should allow us to save 2 additional machine instructions.
| 144C 202F 0084 MOVE.L 0084(A7),D0
| 1450 2239 0000 001A-02 MOVE.L 02.0000001A,D1
| 1456 C1C1 MULS.W D1,D0
| 1458 D085 ADD.L D5,D0
| 145A 2C00 MOVE.L D0,D6
WOW! Check that out! It saved *3* instructions! (6 bytes)
57 occurences of GetCell * 6 bytes=342 additional bytes saved.
Maximum efficiency achieved! No need for an asm version.
* Speed up MSGRandom: Here is the old code (34 lines)
| 0028 2039 0000 0000-01 MOVE.L 01.00000000,D0
| 002E 223C 0001 F31D MOVE.L #0001F31D,D1
| 0034 6100 0000-XX.1 BSR.W __CXD33
| 0038 2001 MOVE.L D1,D0
| 003A E980 ASL.L #4,D0
| 003C 9081 SUB.L D1,D0
| 003E 2400 MOVE.L D0,D2
| 0040 E582 ASL.L #2,D2
| 0042 D480 ADD.L D0,D2
| 0044 EB82 ASL.L #5,D2
| 0046 D481 ADD.L D1,D2
| 0048 2002 MOVE.L D2,D0
| 004A E780 ASL.L #3,D0
| 004C 9082 SUB.L D2,D0
| 004E 2F40 0008 MOVE.L D0,0008(A7)
| 0052 2039 0000 0000-01 MOVE.L 01.00000000,D0
| 0058 223C 0001 F31D MOVE.L #0001F31D,D1
| 005E 6100 0000-XX.1 BSR.W __CXD33
| 0062 2200 MOVE.L D0,D1
| 0064 E581 ASL.L #2,D1
| 0066 9280 SUB.L D0,D1
| 0068 2401 MOVE.L D1,D2
| 006A E982 ASL.L #4,D2
| 006C 9481 SUB.L D1,D2
| 006E D482 ADD.L D2,D2
| 0070 9480 SUB.L D0,D2
| 0072 D482 ADD.L D2,D2
| 0074 9480 SUB.L D0,D2
| 0076 E582 ASL.L #2,D2
| 0078 D480 ADD.L D0,D2
| 007A E582 ASL.L #2,D2
| 007C 202F 0008 MOVE.L 0008(A7),D0
| 0080 9082 SUB.L D2,D0
| 0082 2E00 MOVE.L D0,D7
Here is the new code after changing the C code to use DIVL: (33 lines)
| 0028 2039 0000 0000-01 MOVE.L 01.00000000,D0
| 002E 223C 0001 F31D MOVE.L #0001F31D,D1
| 0034 486F 000C PEA 000C(A7)
| 0038 6100 0000-XX.1 BSR.W @ldiv
| 003C 584F ADDQ.W #4,A7
| 003E 202F 0010 MOVE.L 0010(A7),D0
| 0042 2200 MOVE.L D0,D1
| 0044 E981 ASL.L #4,D1
| 0046 9280 SUB.L D0,D1
| 0048 2401 MOVE.L D1,D2
| 004A E582 ASL.L #2,D2
| 004C D481 ADD.L D1,D2
| 004E EB82 ASL.L #5,D2
| 0050 D480 ADD.L D0,D2
| 0052 2202 MOVE.L D2,D1
| 0054 E781 ASL.L #3,D1
| 0056 9282 SUB.L D2,D1
| 0058 202F 000C MOVE.L 000C(A7),D0
| 005C 2400 MOVE.L D0,D2
| 005E E582 ASL.L #2,D2
| 0060 9480 SUB.L D0,D2
| 0062 2602 MOVE.L D2,D3
| 0064 E983 ASL.L #4,D3
| 0066 9682 SUB.L D2,D3
| 0068 D683 ADD.L D3,D3
| 006A 9680 SUB.L D0,D3
| 006C D683 ADD.L D3,D3
| 006E 9680 SUB.L D0,D3
| 0070 E583 ASL.L #2,D3
| 0072 D680 ADD.L D0,D3
| 0074 E583 ASL.L #2,D3
| 0076 9283 SUB.L D3,D1
| 0078 2E01 MOVE.L D1,D7
The line saved was the expensive subroutine call to perform the 2nd
division operation.
I traced through both versions real quick and it looks like they are both
the same speed due to the ldiv routine containing 2 subroutine calls. It
looks like ldiv does the exact same thing as x / y ... x % y
This is probably a case where ldiv is _supposed_ to be faster but the
compiler writers never made an optimized version. I will leave the
original code intact for now and maybe I will do a detailed cycle count
later.
* Changed:
if ((isGrowth (i) || isCloaked (i)) && spell == CloakID) continue;
if ((isUndead(i)) && spell == LichID) continue;
if (!(isUndead(i)) && (castinfo & CAST_UNDEAD)) continue;
To:
if (spell==CloakID && (isGrowth (i) || isCloaked (i))) continue;
if (spell==LichID && (isUndead(i))) continue;
if ((castinfo & CAST_UNDEAD) && !(isUndead(i))) continue;
Result = faster code = saves the execution of 27 instructions.
* NOW, after all that, computer treecasting should be noticeably faster on
the A500 than before.
Growth Rates are still a bit too high but especially Violet Fungi so:
* I just changed SPUD_CONSTANT from 5 to 6 and FUNGI_RATE from 30 to 40 in
at attempt to keep growths from taking over the world. Now I've played
some test games with it like this and it seems just GREAT! Now it is
working the way I envisioned it! (Except I haven't tested Purple Fungi
yet so I don't know about them.)
Can't see the Ogre Mage shot most of the time so:
* I inserted a WaitTOF(); into the BirdShot routine to hopefully fix this.
The BirdShot uses BLOB_WEAPON which is the easiest to draw. I think it
had just been drawing to fast.
* BUG: Bird Lord shot me and it didn't redraw my cell. (I was invulnerable
at the time, if that makes any difference)
Bird Lord shot another creature and it was redrawn properly.
NOW FIXED.
* The 2nd voice sample in ChaosTheme1 just didn't sound right so I deleted it
and saved 49k. Now my small themesong is only 201k. Hopefully that will
fit into a 512k chipram intro.
**** After months of not playing a single serious game I decided to play a
real game. Here are the results of the Tuesday Playtesting.
A wizard with lots of creatures and a doube-triple put all 6 of his armours
on the _same_ creature even though he had other creatures that were
wounded. He wasted at least half of his armours.
Same game later on... Right now there is a DEAD pegasus. It says dead and
it has the dead image. Yet it has life and people are attacking it. ??
It was next to a shadowwood so maybe when a ShadowWood kills something this
is what happens? This was probably caused by a growth and is probably
FIXED now.
Fire covered up my wizard who was on a horse but it didn't kill my team and
it didn't put my creatures to sleep and I could still play (but without my
wizard).
When I click on the cell that I was on I can see my powerups just like as
if I was in a tree.
Next turn I killed the fire with my creatures and uncovered my wizard and
everything was back to normal.
****** END OF TUESDAY PLAYTEST.
********** Thursday Playtesting. **********
* Thursday: Relatives came over and we played 2 games of chaos. The
first one only lasted about 5 turns because my tree collapsed and I was
simultaneously attaced by 2 Platinum Dragons and 1 Golden Dragon and they
didn't want to play after I was dead. The second game only lasted 5
turns also because the electricity went off. 8( Here are the BUGS we
found:
* HighlightSprite kept highlighting some tree each time it was Matt's turn.
(he was player 3) No big deal, it just looks funny. We kept making
jokes that he must have a "Magic Owl" in that tree or something. FIXED.
* Independent Spiderwebs didn't show up at first due to no ReDrawCell
command. FIXED.
2 different Computer Wizards cast CLOAK and then aborted the spell
because they were in a tree and they had no creatures yet.
They all agreed that the statnumbers should be more uniform. Like all
0-7 or all 0-15 or all 0-63. (or at least nearly all the same)
This subject was brought up because this was the first time they had ever
seen the numbers on the info panel. They _really_ liked that.
*********** End of Thursday Playtesting ****
FRIDAY == 3 WEEK DEADLINE.... Did not hear from you.
**** Friday Playtesting:
* When a growth no longer covers a dead body the body becomes "unalive"
FIXED.
Computer wizards aborted Combat, Cloak, Raise Dead.
A Computer-controlled wizard just mounted an independent Nightmare!
But then someone killed the nightmare so I never got a chance to look at it
on the info screen. Maybe the explanation is that the wizard just subverted
it when I wasn't looking?
4th from the bottom, 7th from the right, the green ooze is being drawn 1
pixel too far down. Cell coords must be off for that cell.
it is DEFINITELY being redrawn 1 pixel too low.
Sometimes the blob is drawn off by about 3 pixels.
I moved my wizard into this strange square and at first it drew it
correctly but then it moved it down 3 pixels. Strangness.
At this point the xpixel[] and ypixel[] arrays are working but the
ancol[]/anrow[] arrays got corrupted somehow. There must be some bug that
writes out some data to a place it isn't supposed to. Possibly it does a
+=3 or a +=4 to account for the 3 or 4 pixel offset.
But there are no occurrences of +=3 or += 3 8(
Now that I think about it, at first it was off by 1 so maybe it was several
+=1 operations somewhere. This is all probably related to the wizard with
LichLord being covered by my green blob.
Whatever bug caused this could easily be causing those spurious crashes.
The game hasn't crashed on me in a very long time.
Blob covered up computer wizard and "killed" him but the game didn't end
and his powerups show when I click on that blob. This might be because the
computer wizard in question has LichLord.
Next Turn:
WOW! Now the covered wizard just cast invulnerability on himself.
He can't attack or move though, apparently.
Next Turn:
Now he just vengeanced my elephant!
Next Turn:
Now he cast a Spectre! And he is still covered up by the green blob.
As far as I can tell this is exactly the way it is suposed to work due to
him having LichLord. I have no complaints. It is just freaky. 8)
**** END Friday Playtesting.
Sunday: Tried to make an autobooting version of Chaos for 1.3. I've done
this before and it always worked but now it loads then crashes. I don't
know why but it might be because of that stupid ptreplay.library.
I went to an awful lot of trouble to avoid using OS2.0+ functions so that
it would work on all Amigas.
Ok, I just tested it and it DEFINITELY is the ptreplay.library that is
causing the crash on the 68000.
Monday-Tuesday Job Fair.
Tuesday Night:
* Speeded up WeaponEffect
* Speeded up ThreeBeam
* On a screenfull of creatures I often can't spot the victim of a
DarkPower/Justice/Exorcise/Vengeance so now the victim is HighLighted.
1 week goes by...
Tuesday Morning: Begin version 1.81
* Improved the Docs to be in sync with the new version 1.8 features.
* Acquired the OctaMED/RBF software play routines directly from
Ray Burt-Frost himself. I have no idea if I am actually going to use
any of it though.
* Put my Lame old icon into the distribution.
1 week goes by...
Tuesday Morning:
* Fixed off-center WizardExplode.
* Changed descriptions of Dark Power, Exorcise, Justice, Vengeance,
Consecrate, Invert and Brain Boost.
* Inserted CheckPixelArrays(); code in the beginning and ending of most
functions to try to find that screwed up mysterious bug.
Violet Fungi growth rate STILL WAY TOO HIGH.
* I have now instituted a new growth formula which will hopefully make the
growths do what we wanted. And I put SPUD_CONSTANT back down to 5 like
it used to be.
On AnRow check it got an error at x=2.
AnRow[2]=0 but somehow AnRowBackup[2]=161!!!!
AnRow[3]=7 but somehow AnRowBackup[3]=65 !!!!
AnRow[4]=0 but somehow AnRowBackup[4]=193!!!!
AnRow[5]=0 but somehow AnRowBackup[5]=97 !!!!
Detected on first line of ReDrawCell, called from cMoveNonEngaged in cmove.c line 316
Power went out. Start over.
5 hours later... Bug detected again. This time an Elemental is highlighted.
AnRow[9]=162 but AnRowBackup[9]=161
AnRow[10]=833 but AnRowBackup[100=65
Called from Reinstate move.c 248 (cell param=224 wizard_warn=0 board[cell].id=59)
which was called by move.c Combat line 539 (defence=224)
* Sheesh! I finally tracked it down completely.
It turns out to be a bad subscript error.
The trouble was with granting a bonus spell to the independents upon
killing a tough creature. In this instance an Independent Elemental
killed a Golden Dragon and so a bonus spell was marked in
wizards[player-].BonusSpells But wizards doesn't have that many elements
(9-1)=8 and wizards highest element was 7.
*** NOW FIXED *** by increasing the size of wizards by 1.
Here is the code that triggered the bug:
if ((bonus = board[defence].char_stat.BonusSpellPick))
{
wizards[player - 1].BonusSpells += 1;
wizards[player - 1].BonusSpellsPick += bonus;
AUDIOPlay (1000,10,1,20);
* Trying out a new growth formula.
* You will notice that there are tons of calls to CheckPixelArrays();
I don't want to go through and delete all these calls because I intend to
use these calls to check for other corrupted variables. So if you don't
like the way it slows your 25Mhz 030 down to 7Mhz 000 speed then you can
just comment out all the code inside the function itself; making it a
null function or perhaps we could use conditional compiling? Smake dev
compiles those lines while smake release doesn't?
* I just came in the room and looked at the screen and I noticed something:
The graphics seemed much more appealing than they used to be. The screen
is filled with all sorts of little animated critters plus loads of webs
and some earthquakes. It just all looks enticing and interesting
somehow. All the extra movement from the faster frame rate makes
everything more exciting.
Monday:
* Allegedly fixed the bug where computer wizards cast Raise Dead on
growths.
* Allegedly fixed the problem of Computer Wizards casting Armour on
creatures with max life.
================== End Version 1.8x ===============================
================== Begin Version 1.9 ===============================
--- Star of changes made by SAI ---
* Incorporated new image data.
* Added C image drawing program, to compile to a "smake image"
* Modified lmkfile and makechaos to generate my chaos font
* Added the following new spells:
Derro, Mud Man, Spriggan, Agathion, Annis, Azer, Banderlog,
Bodak, Cat Lord, Jann, Marid, Shade, Dao, Bandit, Hybsil,
Fire Bat, Shadow Dragon, Spectator, Crimson, Drelb, Haunt,
Juju, Solar, Quickshot, Discard, Boil, Passage.
* Note, I could find not evidence of you changing the descriptions
of Invert, Justice and so on. I assume you did it in pool.txt
but apart from my new spells no significant differences could
be found between the files.
* Fixed the graphics for the golden and platinum dragon.
* Played a game; quickly remembered that I hadn't finished the coding
for all my new spells. The image for Quickshot has some how got
inverted, very strange. There were still lots of dead wizards
lying about the screen. A cloaked sleeping dragon did not appear
cloaked on the screen. The program crashed when a manticore shot
a magic wood tree.
* Made a change in move.tex hopefully to stop dead wizards.
* Added the SPRITES flag to the Chaos screen.
* Discovered that CHAOSANIM is causing a huge number of enforcer
violations. I suspect this may be because there is an unbalanced
ReleaseSemaphore in the program. It seems to start happening
after a wizard dies. I removed my changes, but it didn't improve
the situation.
* My monitor started flickering on an off, so I quickly made up an
archive of what I had done in case it blows up.
* Completed the preliminary coding for the spell manager for creatures.
* Completed spell files up to Stone Golem (it is taking a while to do
each one, but I figure it will be helpful in the long run).
* Perhaps the crashes are due to problems accessing HighLight variables.
* Fixed a bug wherby a dead wizard with the "Uncertainity" spell could
result in dead creatures being case as if they were alive.
* Allegedly modified te freeze spell to work on independents.
-JC tested this and it really works.
* Major Discovery: If I boot from a floppy by-passing my usual startup
then the game worked much better in that JC sprite appeared. Therefore,
I am going to have to investigate my startup sequence to find what
causes this.
* Done spell files up to and including vampire.
* Completed spell files for all objects on the board.
* Whew, I have just finished making spell files for all our
spells (all 255 of them, now I added my new ones). The next
one should be interesting since any byte quantities hanging
around related to spells might break. Well, I won't be
adding any more for a little while anyway.
* Now trying to incorporate changes.
* Change the ordering of spells by swapping LichLord with Mutate
(so that all computer assistance spells come after consecrate).
* Deleted initial_data, names, and speech from prog.tex
* Deleted chaos.prb and ranking information from spell.tex
* Deleted castinfo and computer assist arrays from cast.tex
* Made appropriate changes to make file.
* Now testing the spell manager. Having a few minor problems with the
script I wrote. Added a FAILAT to stop if halting for no real
reason.
* Deleted reincarnation table from move.tex.
* Deleted index.h pool.txt makedata.txt from archive.
* Now trying to remake entire game from archive. Problems: changed
targets for info.o. Fixed problem with index.h. There is a problem
with makedata.txt, for testing overcame by deleting lines. It is
caused by bad referencing of statics. I will have to change the
spell manager to cope with this.
* OK it all compiled and I proceeded to play a game. The was obviously
a problem reading "chaos.prb" because all the spells were unusual ones.
Fixed that problem. But then the game crashed just after a wizard died.
Suspecting my fix to stop dead wizards I have temporarily disabled it.
The whole problem of killing wizards needs a good going over and
rationalization.
* Eventually the spell manager could be modified to print nice tables
of creature abilities for inclusion in the manual.
* Fixed alignment of first set up screen.
* Made the game load my font from a local directory by following JC
example. However, I noticed you used FPB_DISKFONT instead of
FPF_DISKFONT (I wonder who is right). I've left it for the moment.
I wonder if this could have something to do with SetSoftStyle bug.
* Fixed some bugs to do with scoring.
* Allegedly changed Texas'em so that when less than six spells remain
no discard is required. This probably needs some sound to stop people
clicking on each others spells. Tested OK.
* Added variant spider webs, this has pushed the number of spells over
255 and some problems might occur.
* In testing I have observed a number of Enforcer hits corresponding
to long reads. Reasons remain unknown.
* Fixed the loading/saving problem. It was caused by a single line
missing from the start.tex file (InitLoad();)
* Added some mechanism for a turn counter. There is no warning that
the game is about to end, also the scores aren't shown at the end.
* Replaced About menu.
* Added turn counter and discarding flag to the save file.
* Fixed a bug relating to the Dao.
* Elimited the single pixel blue line from the top of the screen.
* Replaced the new game menu.
* Completed implementation of the discard spell.
* Completed implementation of the quickshot spell (image still revesed tho).
* Just noticed that team scoring is broken. Something I changed here
is screwed up.
* Fixed screen clearing when loading a saved game.
* Discovered a potential problem with the semaphore in Reinstate, this
makes sense for the causes of all my recent crashes, attempting fix.
* Split the WeaponEffect procedure into two parts so it is more versatile
(planning to use it in the Quit menu).
* Replaced the quit menu.
* Only the file menu now relies on reqtools, and will continue to do
so in the mean time.
* Since it is possible that JC will lose account I am now making a new
archive and testing a complete remake. If it works I send it.
* Rewrote the Reinstate function, thereby eliminating KillWizard,
Reincarnate and KillElemental.
* Fixed yet another bug to do with discarding.
* Fixed a problem relating to the Eartquake and my change to the Reinstate
function
* Incorporated JC font changes.
* Incorporated JC spell description changes.
* Made the solar always move on its own accord.
* Made the Cat Lord more rigourous. Technically, there should only ever be
one Cat Lord at a time (ok, there are some ways around this, but they
will probably be entertaining if they occur, so I'm leaving them). The
Cat Lord should now move all cats. The latest code does prevent multiple
Cat Lords from being cast or generated.
* Put all the code for CastFree spells in the appropriate spell files.
Modified the spell manager to automatically amalgamate this code and
put it in a file to be included by cast.tex.
* It is still sticking an image when a generator dies. This is wrong. I
think it may be because we are the near the byte limitation, I am trying
a temporary fix, soon I will change all id fields to words instead of
chars.
* Had a brief go at doing favourite food etc., but remembered that because
of a change to the cell scoring (in that it now does it once rather than
for each and every creature) that it will be harder to do this than I had
imagined.
* Completed implementation of the haunt and solar.
* Did some optimisation and tidying up of BoardUpdate.
* Implemented computer discarding for Texas trash'em.
* Stopped computer wizards from attempting Cat Lord while one on screen.
* Fixed a problem with dead graphics.
* Implemented agent casting of general magic spells.
* Completed implementation of Agathion.
* Allowed faun to cast sleep.
* Allowed azer to cast quench.
* Stopped horrors reproducing after the first time.
* Completed implementation of Dao.
* Agents now highlighted and show owner when casting.
* Completed implementation of Jann, Dao, and Marid.
* Stopped Justice, Dark Power, and Vengeance on growths.
* Allegedly fixed scoring (now tested, it looks ok).
* Changed the basic cell id to a UWORD, this gives a lot more freedom
for making new spells.
* Tidied up some of the documentation in prog.tex and moved all the menu
stuff to a separate file, menu.tex.
* Did a complete rebuild, it took 43 minutes.
* Moved all the magic spell handlers to the appropriate spell files.
* Changed the reincarnation table to be USHORT rather than UBYTE
* Made the spell manager write a TeX table of basic abilities. Later I
will make other tables and convert them to PostScript.
* Turned on highlighting for Speed and Slow spells
* Turns remaining now displayed on the far right of the screen at the top.
* Turn counter stuff now works reasonably well. The game will stop when
all turns are exhausted and the scores will be given.
* While team scores now seem correct, the don't appear correctly sorted;
this looks like another +/- 1 type problem, that my brain just doesn't
feel like trying to fathom at the moment.
* Added StartTiming and EndTiming to prog.tex (at the end). Didn't have
time to test it much but hopefully it will do what you want.
TODO:
- Computer use of favourite food stats
- Elimination of reqtools
- More production of TeX/PS tables of abilities.
- Find exec.dis and stamps for JC
- Power up goodies on screen
- Complete Passage [now made prob 0 pending appropriate solution]
- Make computer use of reincarnation more intelligent
- Start of changes by JJC -
* Problem: Start Chaos and Quit. An Alert pops up (like a guru but yellow
and non-fatal) that says "Recoverable Error: 0100 0008"
I looked it up and that means "Damaged Semaphore". NOW FIXED.
* Test a medmod with the cli medplayer program to see if it shares channels
or not. IT DOESN'T.
* Edited descriptions of Marid,Rat.
* Fixed up Timing Code.
* After an hour of getting bizarre results I have reached the conclusion
that the SASC Timer function does NOT have microsecond resolution.
Instead it has 1/60th second resolution and it then adds +/- 1 to 3
microseconds onto that result.
* Implemented asm TestPixel.
Time to Test 32 rows of 320 pixels on a 5 bpl lores screen on 25Mhz 030
ReadPixel 500009us
TestPixel 100002us
So TestPixel is about 5x as fast as ReadPixel.
* When simulacrumming an unanimated creature with double in effect it is not
drawn immediately. In fact it isn't drawn till something triggers
ReDrawAll=YES. NOW FIXED.
Subversion appears broken. Player 1 subverted a White Dragon and it made the
success sound but didn't make it mine. Player 2 just subverted a different
White Dragon and it made the success sound and it DID make it mine... hmm..
The only thing I can figure is that the spell works perfectly and I just
mistook the sound effect.
* I noticed that Reflector always did exactly 3 points of damage to the
shooter rather than actually "reflecting" the damage back to the shooter.
e.g. A White Dragon shot me and it should have "reflected" 9 points of
damage back to him but instead only did 3.
Also, if the wizard had a 15 Ranged Combat Rating then even a Camel would
get hit with 15 points of retaliatory damage.
Also, if an Undead Shooter shoots an ordinary Reflectified Wizard then
the damage does NOT reflect onto the shooter; instead it is an "invalid
attack, cannot attack undead"
So in fact either the spell should be renamed to "Retaliation" or
"Retaliatory Strike" or the Reflector Spell Code should be reworked to
actually "reflect" the incoming damage.
I chose to rework the code so now the exact damage is always reflected
onto the shooter. Even the exact _type_ of damage is reflected:
Intelligence damage is reflected as Intelligence damage. Ditto for
poisoning and all the other stats.
I cast Reincarnation on my Manticore which my wizard was riding at the time
but when they killed my Manticore it didn't reincarnate into a Centaur! It
just died and disapeared like usual! 8(
* Implemented linearly equidistant ascending order bitplanes. Works fine.
From now on all custom gfx routines can gain an extra 15% or more speed
due to this fact.
* Rewrote TestPixel to take advantage of the equally spaced bitmaps but the
timer is so lores that it doesn't show any speed increase. 8(
It should be about 6x faster than ReadPixel now.
Perhaps if I do a smake release then try timing it then I can get more
accurate results.
* Upon noticing that the isLineOfSightTest really does only check the first
4 bitplanes I changed TestPixel to work the same way and made another
optimization as well. Saved about 20 cycles. But I don't understand why
it was only checking 4 bitplanes?? That means that all colors from 16 to
31 are all "transparent" and don't block line of sight. Do any game
objects currently use colors 16 to 31???
- SAI: No this code IS correct. Colours 16 to 31 are used and do block
LOS.
- JJC: Ok it all makes sense to me now.
* Once I looked at isLineOfSightTest I realized that I somehow COMPLETELY
missed this routine before! I just greatly optimized it. It should be
about 2x to 3x as fast as before.
* OK NOW AT LONG LAST, COMPUTER TREE-CASTING SHOULD BE ABOUT 3x as fast as
before!!!!!!
* btw: You can verify that ReadPixel and TestPixel are in agreement by
pressing the a key. The b key measures the speed of ReadPixel and the
c key measures the speed of TestPixel.
*** SPLIT SCREEN TECHNOLOGY UPGRADE ****************
Right now the WriteNearBottom text can go all the way to the edge and beyond
beyond so a hi-res screen will keep it from going off the edge.
* Implemented Split-Screen Technology. Or in the present form it might be
better referred to as Dual-Screen Technology.
I've wanted to do this since December 1996. Well, actually I've wanted to
make a split-screen game since September 1985 when I first saw the Amiga's
HiRes mode. Using dual screens allows the presentation of HiRes
sharp-looking text while also allowing the use of really cool finely
textured 64 color graphics on the A500.
I've seen so many games over the years that could have greatly benefitted
from using a split screen. Every time I see a game that doesn't use one I
want to go into the program and MAKE it use one. EVERY Amiga ever made
(even the original 1985 A1000) supports 640x200 resolution so there is
simply NO EXCUSE not to use it! I want a game that makes use of my
computer's capabilities.
I don't mind large fonts, its just that I do mind _blocky_ fonts. 320x200
text just doesn't cut it for me.
* Changed WriteBottom and WriteNearBottom to work with the new system.
* I had to change the WriteBottom statement in braindrain.spl and nuke.spl
to keep it coordinated.
* New function PutScreen which is easier to work with than MoveScreen.
* I am trying to keep the HiRes screen down to only 8 colors so I had to
eliminate 3 colors from the CreatureInfo screen. 16 color HIRES is
extremely slow.
Color list from info.tex:
GREEN1
GREEN2
BLUE1
PINK
RED3
YELLOW
CYAN
BLACK
WHITE replaced with CYAN
BROWN replaced with PINK
ORANGE replaced with BLUE1
* Translated the above pallete onto the HiResScreen.
* Translated SpellInfo Screens onto the HiResScreen.
* Translated Creature Info Screens onto the HiResScreen.
* Translated Game Loading/Saving onto the HiResScreen.
Now we just have to decide what we are going to do with all that extra
space. Do we use bigger fonts? Do we combine the 1st and 2nd screens
together? ???
***** END OF SPLIT SCREEN TECHNOLOGY UPGRADE *****
>* Subversion of a sleeping creature did not clear Sleeping Stat;
> although the owner was correctly changed.
Ok, I didn't realize that Subversion was supposed to wake creautures up.
Now it does.
>* When a cloaked creature goes to sleep the cloak image disappears;
> although the creature keeps the cloaked stat. That in itself is not a
> problem; however, once woken the cloak image does not return.
Ok, I fixed it so a sleeping cloaked creature who is awakened will show up
graphically as a cloaked creature. Not tested due to problems with
makefile not rebuilding castmagic.c.
* The sequence Cloak->Sleep->Wake produces a cloaked creature on
your side, but although info fails on it, the animated graphic
is visible! This should now be fixed but someone needs to test it to be
sure.
I haven't decided what to do about putting a cloaked creature to sleep.
How do you want that handled? Do you want it to still appear graphically
cloaked or ?
--SAI: Visible, one could assume that maintaining a clock requires effort
therefore a sleeping creature doesn't maintain it.
>* Agents (Dao, Marid, etc.) look at the wrong player when testing for a
> double or triple effect. I suspect this is another off by one effect.
> (Should be easy to find this problem in AgentCast).
JC is not attempting to fix this one due to never knowing whether to use
Array[x] or Array[x-1] or Array[x+1]. Leaving this for SAI.
--SAI NOW FIXED
BUG: smake newspell doesn't rebuild the file castmagic.c from the
individual .spl files. It just ignores the new .spl files and uses the
same old castmagic.c file as before.
btw: I deleted castmagic.c and then did smake newspell but that didn't work
either. It still didn't rebuild castmagic.c
* I added the line "execute spellmanager" to the newspell: part of the
lmkfile. Hopefully that fixes everything relating to castmagic.c
* Fixed all warnings related to warp.tex
* BUG: Closing the FileRequester or selecting CANCEL does not actually
cancel anything. The game still loads/saves the game. NOW FIXED.
* PROBLEM: Whenever the game stops the animation system for a legitimate
reason the sprite also stops. This results in jerky sprite animation
on all Amigas. On the A500 this is especially noticeable since the
sprite spends most of its time in slow motion and jerking arouind in an
icky manner.
SOLUTION: I have Implemented the sprite animation as a vertical blank
interrupt so it will ALWAYS be animated smoothly, regardless of
ObtainSemaphore() or Forbid(). This makes playing the game on the A500 a
zillion times better. This should also allow the sprite to keep up with
moving creatures better.
* I tried to implement the color cycling into the vblank interrupt but that
just didn't work. It turns out that beyond v36, LoadRGB4 and SetRGB4
cannot be legally called from interrupts.
* Implemented new ChaosColorCycler Task which is responsible for all color
cycling. This allows color cycling to continue unabated even when the
CHAOSANIM Task is prevented from running by an ObtainSemaphore.
* Implemented new method for seeing which stats are attacked by Combat,
Ranged Combat and Special Combat. Just click on Combat and the stats
that it attacks will begin flashing. The old method was just never clear
enough for me. Hopefully this new method will make things more clear.
* Eliminated that 1 pixel of empty space from the top of the screen since
screen real estate is at a premium.
* r=Range; s=Shoot; m=Move;
* Pressing the "r" key now shows the shooting range of the current
creature by highlighting the cells that can be shot. Looks kewl!
* Pressing the "s" key now shows the cells that the current creature
can shoot into (taking into account any LineOfSight requirements).
* Pressing the "m" key now shows the cells that the current creature can
move into.
* BONUS: the new "r" and "s" and "m" routines use the asm SqDistance and
TestPixel routines to provide superfast response!
* FLAW: computer controlled creatures can't shoot quite as far as human
controlled creatures due to the fact that humans are given an extra .5 on
their range while computer players are not. I have now rewritten the
range code such that all shooting ranges are calculated identically for
humans, computers and the "r" and "s" keys. NOW FIXED.
* When a creature is about to shoot, its actual .Range stat is printed at
the bottom of the screen.
* PROBLEM: When deciding which spell to cast, the really cool
auto-mouse-reporting feature that tells you what thing is under your
mouse pointer is deactivated. I've been wanting to keep this active
during spell selection forever. Now I finally did it! YAY!
* The "r" and "s" and "m" keys now work on whatever cell the mousepointer
is over at the time of the keypress!!! (Assuming there is no creature
currently highlighted.) YAHOO! Now we can easily inspect the ranges and
movement capabilities of any creature!!!!
* Now if you press SHIFT+r or SHIFT+s or SHIFT+m it displays the range info
for the creature under the mousepointer _even_ if you have already
clicked on a creature and that creature is highlighted by the sprite.
This allows you to go around graphically inspecting the ranges of
creatures right in the middle of moving one of your monsters!! Kewl!
* Put in some more code to support retargetable graphics.
* Implemented the new Highlighting method on Creations + Allies with
numeric keys.
* Partially optimized HandleMOUSEMOVE();
FLAW: The Hide spell is listed as a BONUS spell yet I keep getting them
in my startup spell list. I frequently start a game with 2 of these
spells showing. I'm leaving this for SAI to fix as I don't know anything
about the spell probability system.
Nov. 6th: sent complete archive to SAI so he can decide if he wants to make
a new version of the Chaos.font that is either 8 tall x 16 wide or 12x12 or
8 tall x 12 wide; thus allowing the font to be smoother, larger and
(hopefully) easier to read.
--- Changes made by SAI ---
* Fixed the bug pertaining to the Dao, Marid etc.
My monitor is being a real pain on a day when I was hoping to fix lots of
little things. It worked for long enough to be impressed with the s, r,
m keys new info panels etc. I like them all. Now switching to my old 11"
monochrome screen.
* Implemented flying pointer.
* Fixed Invert slowness.
* Fixed Hide spell showing up on spell lists inappropriately
(actually caused by Passage having rank 0 and prob 100)
* Gave Marid and Dao to more sensible probabilities.
* Added Edit option to first menu. It is just a stub at the moment
so that I can work on it while you work on the main game.
* Added code to support a classic option
- New global variable "classic"
- New gadget on second SetUp screen to select mode
- Changed io.tex to save "classic"
- Change program to reload spell probs for each new game
- Change Spell Manager to produce both chaos.prb and classic.prb
So far Faun is the only classic creature! I need to update the spell
files to show which are classic. NOW DONE.
* Fixed quickshot imagery
* Allowed reincarnation of creature even when mounted.
* Added new spells: Abath, Abduction, Acid Rain, Amphisbaena, Archery, Betrayal,
Thundermare, Iridium Horse, Chaos Lord, Devastation, Disection, Hidden Horror,
Mana Battery, Meddle, Necropotence, Points, Bipedal Generator.
I was amazed at how easy adding new spells is now. No more having to worry
about making sure I added all the appropriate pieces of information. All you
have to do is bang together a new spell file and change a couple of other
things. Once upon a time it would have taken a week to add this many new spells.
I've done it in four hours (I must admit I haven't tested them yet) and I
didn't yet complete the implementation of Necropotence. The new general combat
system is really cool for adding stuff as well.
JC you might want to check the descriptions of these new spells the are bound
to need tweaking. I haven't ad time to proof read them properly.
* Implemented the secret powerup Horse->Thundermare->Iridium.
* There was a bug in UpdateBoard that is not looking after wizard stats properly,
I discovered this after implementing the ChaosLord spell.
* Moved powerup display hard left on info screen. I now think this might better
go on the line under the name line. Needed to move it left because some wizards
ad so much stuff it was going off the right of the screen. Also had to move it
up slightly.
* Set the Classic flag for all the appropriate spells. Also changed the game
to start in "classic" mode by default.
* Allegedly fixed a problem that was causing the game to hang on Quit.
* Modified the I/O routines to save the entire probability table with a saved
game. NOW TESTED, all seems to work.
* Added tex2c.c to archive. Actually this is a tool I have used on lots
of projects and originally I had visions of making it a farily powerful
thing, but that never eventuated.
Doing one last rebuild to test and then sending archive.
SAI -- ReleaseS
JJC -- ObtainS Begin Version 2.0
* Played 1 small test game to get a Thundermare and an Iridium Horse.
Awesome!
* Made minor changes to most of the new spell descriptions: Abath, Abduction,
Acid Rain, Amphisbaena, Archery, Betrayal, Thundermare, Iridium Horse,
Chaos Lord, Devastation, Disection, Hidden Horror, Mana Battery, Meddle,
Necropotence, Points, Bipedal Generator.
Are independent creatures really attracted toward Mana Batteries?
My fave new spells are ThunderMare, Iridium Horse, Chaos Lord and Archery
(hey you stole my spell!). I rather liked many of the new spell
descriptions; one or 2 of them made me crack up laughing and most were just
plain interesting to read.
* 1 bug in DoComputerCast removed.
* I could find no evidence in the casting code of Depth removing LOS
requirements so I changed the description of Depth accordingly.
* For humans, Depth only worked on spells > ImpID yet for computer wizards
Depth just plain worked for everything. I adjusted it to be >ImpID for
everyone.
* DoComputerCast never checks the CAST_GROWTH bit. This explains why they
cast weird spells on growths. They were cheating!
* DoComputerCast never checks for the presence of an Arborist spell. Poor
guys. They could NEVER put 2 trees next to each other.
* That's a total of 4 discrepancies between DoCast and DoComputerCast. I
fixed all this by writing a new "Grand Unified Spellcasting Rules Function"
that DoCast and DoComputerCast and the "c" key all use to determine if a
postulated cell/spell/wizard combination would be legal or not. This
should help to eliminate lots of bugs in the future. From now on, all
spellcasting rules just go one place ObeySpellCastingRules. This ensures
that both computer wizards and human wizards and agents all follow the
exact same set of rules.
I noticed this line in the cast.tex:
HighLightCell = (WORD)cell; /* first to give some time to catch up */
btw if you ever want to make _sure_ that the sprite has caught up then you
can just do a WaitVblank(1);
I've never done that because I didn't want to slow down the game with a
bunch of Waits. And anyway now that I redid the sprite animation as a
vblank interrupt it is now IMPOSSIBLE for an ObtainSemaphore to stop the
sprite from being redrawn at the correct position for long periods of time.
So the maximum length of time to catch up is 1/50th of a second.
* c = casting. During the spellcasting phase you can press c and all the
legal targets for your spell are highlighted in the color cycling color.
This can be useful in the regular game as well as for testing the
spellcasting rules.
* q = query = question mark to bring up info screens.
Hey this is sort of cool, driving around the screen with the mouse in one
hand and the keyboard in the other. It is now very quick and easy to zip
around with the mouse and press q to see the info screens. q,s,r and c are
all on the left hand side of the keyboard. Only m is on the right hand
side, so your left hand can sit on the keyboard and your right hand on the
mouse. Maybe we should have a=m=move because a is on the left hand side of
the keyboard... but a should really be attack so I dunno...
* Added new subsection to the docs {Keys} Plus other small improvements.
*********************************************************************
Mini Level Editor Upgrade:
* ALT + d = Delete
* ALT + c = Copy
* ALT + p = Paste
* ALT + o = Object (This lets you pick any object from the game and place
it anywhere you like!)
This works with a hierarchical menu system which allows you to find
the creature you are looking for according to how you think of it.
Click the Orc to get a list of all ground creatures.
Click the dead Orc to get a list of all dead ground creatures.
Click the Orc scroll to get a list of all ground creature scrolls.
Click the Skeleton to get a list of all undead ground creatures.
Click the Skeleton Scroll to get a list all undead ground creature scrolls.
Click the Harpy to get a list of all flying creatures.
Click the dead Harpy to get a list all dead flying creatures.
Click the Harpy Scroll to get a list all all flying creature scrolls.
Click the Ghost to get a list of all Undead Flying creatures.
Click the Ghost Scroll for a list of all Undead Flying creature Scrolls.
Click the Wall for a list of all inanimate objects.
Click the Wall Scroll for a list of all inanimate object scrolls.
Click the GooeyBlob for a list of all Growths.
Click the GooeyBlob Scroll for a list of all Growth Scrolls.
Click the Horse for a list all Mounts and Meditations.
Click the Horse Scroll for a list all Mounts and Meditations Scrolls.
Click the Green Dragon for a list of all Level2 Mounts.
Click the Green Dragon Scroll for a list of all Level2 Mount Scrolls.
Click the Wood Elf for a list of all Archers.
Click the Wood Elf Scroll for a list of all Archer Scrolls.
Click the Bolter Wall for a list of all things that can shoot.
Click the Bolter Wall Scroll for a list of Scrolls for things that can shoot.
Click on the Armour for a list of all Magic Spells. ( > ExitID)
After you click on the actual object that you want then just click on the
board where you want it and *poof* it will appear there. It will also be
in your copybuffer so you can paste successive copies with ALT + p.
These keys require ALT for now so that people who aren't supposed to know
about them won't. Unfortunately, having to press 2 keys to do something is
not user friendly so we either need "Edit Mode" or gadgets that do the same
things as these keys.
These are very simple and don't have any special code for handling wizards
or the lists associated with list agents. Nevertheless it is possible to
edit levels with these commands. And since they are all #ifdef'ed they
take up about 0 bytes in the smake release.
* Lots of new predicates all #defined in predicate.tex which work with
object ID's instead of cells.
All new predicates are thus far used only in the level editor code:
isIDinanimate(id)
isIDgrowth(id)
isIDundead(id)
isIDflying(id)
isIDmount (id)
isIDdragon(id)
isIDarcher(id)
isIDshooter(id)
**********************************************************************
Azers don't heal even though they have a 2 recovery rate. I see you have
rewritten the recovery code so I'll just leave this for you to fix.
* Added the bar graphs of the recovery rates to the information panel.
* Columnarized the stats on the 2nd info screen so SAI will have room to
implement his "Creatures Killed" stuff. In my notes I called it
"Foes Vanquished"
* Weird graphic glitch: Clicking on the word combat causes a rectangular
black spot at the top of the screen where the title bar is supposed to be.
This partially overwrites the powerup icons.
I have determined that anytime you click the mouse into a window which is
not currently active that the lores screen gets this black spot but ONLY
when there is a nonbackdrop window in that area. The NewGame window has the
same problem when you click the mouse into the bottom of the screen (the
hires screen). Do you know of some way to disable the OS from redrawing the
TitleBar every time the user clicks a new window?
Are you getting this same glitch on your OS?
The only way I know to eliminate this problem is to just ALWAYS use the
backdrop window for everything. This is something I have been planning to
do for a long time anyway to save chipram.
As a quick and reliable fix (only works on the info screen) I have simply
activated the hires screen FIRST before anything gets drawn.
I also had to remove the autoACTIVATE bit from the newwindow structure.
This way when the user Clicks on Combat he isn't changing windows so the
titlebar doesn't get redrawn.
* Fixed that annoying problem where an independent creature could move next
to one of your creatures and attack it while the highlight sprite didn't
bother to highlight the creature in its new cell until AFTER the attack
was complete and even then it was instantly turned off. This was caused
by the complete lack of HighLighting code in cMoveNonEngaged. NOW FIXED.
The sprite now appears to keep up much better.
* BUG: SpellInformation(); on a WebAID, WebBID, WebCID, WebDID, VWallID,
HWallID, ExitID causes the game to NOT print the spell description for that
spell and it crashes the computer. I don't know how the compressed pooled
descriptions work or how HIDDEN spells are supposed to work so I just leave
this for you to fix. NOW FIXED
BUG: I have a bat with 0 life and -4 recovery but it isn't dying.
SAI: I failed to replicate this problems. I had an azer in the same situation
and it did die.
* BUG: The computer seems to think that player 2 and DEADP are on the same
team. It looked very strange when I pressed "2" and all the dead things
on the screen lit up in BLUE. NOW FIXED.
* YIPERS! Team[] was only big enough for the 8 players plus asleep.
Accessing Team[DEADP] was a bad subscript error. NOW FIXED.
* FLAW: ChaosLord did not set the FLYING_STAT bit of the wizard. NOW FIXED.
* Replaced 3 old slow codes in init.tex with faster GetCell(x,y).
**************************************************
********** MAJOR NEW GAMEPLAY MECHANIC ***********
********** SCROLLS ***********
**************************************************
Read the docs for a complete explanation of scrolls.
Scrolls add the following Play-Mechanics to the game:
1) The "Collect Things" Play-Mechanic.
Sometimes it is just plain fun to collect things and add them to your
colletion. This applies to both games and real life.
2) The "Limited Resources so you better get moving and grab them while you
can!" Play-Mechanic.
3) To some extent it adds the "Colonization" Play-Mechanic because you want
to hurry up and grab as many scrolls as you can early in the game
rather than just sitting in a tree meditating.
I have played many games where I initially hopped into a meditation and
then just cast powerups on myself to avoid confrontation. In the exact
same situation with Scrolls added I would have to rethink my strategy.
I might make a mad dash for an important spell and get drawn into a
fierce battle as a result.
btw: Scrolls make being player 7 or 8 more advantageous.
All in all Scrolls make a powerful additional option for an already superb
game. There are now some intriguing new ways to play the game. Like start
with 0 or 1 spells but 99 Scrolls with you against 3 enemy wizards and 1
generator. It makes the game take on a whole new flavor.
BTW: If we don't get the level editor fully functional for a while now it
is no big deal. You can just play the game with 99 Scrolls and between
those 99 spells + the 20 in your spell list you'll probably have the spells
you want to test available to you.
* There was something in the code whereby if you were obtaining a new
spell but your SpellTable up to the number of Spells you started with
was full then you didn't get your spell. I changed this by replacing
"Spells" with "MAX_SPELLS" in AddGUISpell so that way if you start the
game with 10 spells and cast 2 of them and then get 8 new spells you now
REALLY get them instead of most of them being "lost". I also changed
SpellTable to hold up to 150 spells instead of just 100. Even
though the largest number of spells that you can _start_out_with_ is 99.
* New Predicate isScroll(cell)
* New Function InsertScroll(cell)
* New Function InsertCorpse(cell)
**** Bug report + Fix *********************************************
* I was having a serious bug where scrolls with an ID > RevealID were being
inserted into cells. This caused enforcer hits and lots of crashes.
Here was the guilty code:
if (z==0) z=(MSGRandom() % (ExitID-1))+1;
else
z=(MSGRandom() % (RevealID-ExitID)) + ExitID+1;
It took me a while to figure this out... I looked at it several times and
my math seem to be ok yet IDs greater than RevealID were being generated
by this code.
The problem turned out to be that RevealID is not a simple number but a
"complex constant". It is a large mathematical expression, actually.
RevealID works out to CloakID + 1
CloakID works out to BuryID + 1
BuryID is MagicSheildID + 1
MagicShieldID is OrcsID + 1
ad nauseum
Rule: NEVER USE IDs in anything but simple expressions without
enclosing each ID in parenthesis.
This is one of the drawbacks to using #defined expressions instead of
variables.
FIXED BY: Enclosing RevealID and ExitID in parenthesis. (RevealID) (ExitID)
Maybe we should enclose all #defines in parenthesis in their definition?
SAI: The best solution would be to replace all the #defines by an
enumeration. It would probably lead to faster compilation. However, since
the Spell Manager now depends on the #define list several modifications
would be necessary.
JC: I think if we just enclose each #define in () that will suffice.
**** End Bug Report + Fix *********************************************
***************************************************
********* END OF SCROLLS UPGRADE ***********
***************************************************
Played a test game and teams work fine for the number keys but for
spellcasting they are totally screwed up. All the computer wizards were
casting spells on computer wizards who were not on their team and on human
wizards who were not on their team. I sure hope SAI can figure this out. NOW FIXED
----
ObtainS by SAI
Survived potential heart-attack seeing the archive named "encryptedchaos".
I have always (well not always, but for a long time) wanted something like
scrolls. Full points for actually having the guts to implement it. I can't
wait for it to compile so I can try it! I will also investigate your edit
functions and then try and amalgamate the two editing systems.
Have noted the above unsolved bug reports and will attempt to resolve them.
BUG: Press ALT-o part way through a previous ALT-o and I couldn't get
back to the game.
* BUG: Program lets you select growths to move. NOW FIXED.
BUG: New game followed by quit (sometimes) fails to terminate. I think this
occurs because if ObtainSemaphore has been done the Animator tasks fails
to terminate as expected. This suggests there is something wrong with how
the menu system is using ObtainSemaphore, but I have been unable to trace
this fault.
* Fixed MassMorph to not destroy bipedal generators.
* Made independent attract to Mana Battery.
* Fixed problem of info of spells without description.
* Made minor changes to game docs.
* Made a slight change to the testing of spells during scroll insertion.
* Identified the cause of the Team bug. It is a simple problem with the
spell manager writing assist.h.
* Added my editor into the source code, will try to amalgamate with JC
mini-editor code. Suggestion: to make it harder to accidently discover
ALT-o etc. suggest the user have to type ALT-! before these special
key-presses will work.
JC: I'm not even sure we should have those keypresses in the game at all.
I just DEFINITELY wanted something that I could use quickly to test things
with right then at that moment.
I just threw all that code together in 1 day because it just hit
me how I wanted to do it. It is a miracle that it worked. After I sent
you the archive I tested the editing stuff and was quite pleased that it
actually worked!!
* Started implementation of foes vanquished. Discovered this would mean
lots of changes to move.tex. To ensure I make these changes properly
I'm going to careful go through printouts of this module and also
cmove.tex. Some spell handler may also need to be changed, but I will
ignore that temporarily.
SUGGESTION: Have an option for scrolls where you cannot see in advance
what you scroll will be.
* Added Wizards variant of wizards and made changes in move.tex. This saved
28K.
* Modified editor to work with scrolls.
* Made minor modifications to InsertScroll.
* Put some common cell manipulation routines in a new module core.tex.
Reinstate, Insert*, PutToSleep, ClearUnder, WakeUp.
* Moved WizardExplode effect into cell.tex.
* Added an isGenerator predicate.
* Added scrolls docs to user docs. Didn't do it very well however.
* Combined the JC mini-editor commands (except ALT-o) with my editor.
x is a synonym for d, v is a synonym for p. The the three keys
"XCV" now do cut, copy, paste as is typical in many applications.
In the mini-editor ALT must be pressed, in the general editor ALT
is unnecessary. These key presses still have major flaws when applied
to wizards, but they are a good start.
* Modified InsertCorpse to insert a nothing when passed an argument not
having a dead image. This makes sense, and is now necessary since
InsertCorpse is now called from several places.
* BUG: I have now comfirmed that TestPixel does not seem to work properly
in Spunge. I replaced TestPixel with ReadPixel and the problem went away.
Earlier explanation: The graphic effect used with Dark Power no longer seems to work properly
only works for the lowest 4 bits of each cell. NOW FIXED
* Fixed Abduction and Raise Dead (for some reason Raise Dead was leaving the
corpse underneath). Actually I think that means the corpse was already
there which means there is something else wrong as well.
* Vanquished foes now working including saving of this information. However, I
am not at all convinced that memory is been released properly in all cases
when an object dies, e.g. when a creature falls in a pit. Also when a spell
like Replicate is used, this replicates the vanquished list for that creature
as well (not quite, both creatures end up using the same list--since this is
rather neat I haven't changed it).
* Implemented a bomb explosion effect. It is now used for Nuke and the Goblin
Bomb.
* Fixed the recovery rate code. I did however notice a python that refused to
died (this may be related to the pox or maybe it had been powered up in some
way, I'm not worrying about it unless I see it again).
* Removed another bug from io.tex (a bad bug).
QUERY: Should scrolls be generated according to their probabilities.
Current all spells are equally likely under scrolls and hence powerful
spells are relatively common. I'm not saying this is bad, but is it
what you intended?
Well, it is what I intended for the moment. I just wanted to try something
different. Since I had only played the game with 2 sets of probabilities
(regular and classic) I thought I'd try yet another set of probabilities
just to see how it worked out. I played some test games and it seemed ok
the way it is as long as you play with a small number of scrolls, say
20 or less. But with 99 scrolls there are multiple Touch of God and
Iridium Horse scrolls laying around which I didn't think was the best
thing, however I have a nifty fix for this which I will hopefully implement
this week. Then we can playtest it some more and make a final decision
on the scroll-probability system later. I have many things to do with
the scrolls concept this week.
--- End SAI changes ---
--- JJC ObtainSemaphore --- Begin Version 2.1
************** BEGIN tex2c speed upgrade ****************
* Installed new tex2c.c into the archive. Be sure to compile it
according to the instructions contained in the source.
Or hopefully I'll just Email it to you if I can.
Be sure to replace the old version with the new one in your command
path or you won't benefit from the speed increase.
tex2c: Filesize reduced from 12672 -> 9768 bytes.
tex2c: Speed increase on prog.tex: 35x faster (from RAM:)
tex2c: Time savings on prog.tex: 67 seconds. (From HardDrive)
tex2c: Time savings on complete make: 317 seconds (5 minutes, 17 seconds)
(From HardDrive)
All times were measured on Chaos_2.0 source files.
tex2c: Now works as tex2c filename rather than tex2c <filename.
tex2c: All output files are identical with the old tex2c.
tex2c: No assembly language used in order to help preserve
multiplatform compatability.
tex2c: Read source code for more detailed timing tests and exact
description of changes made.
************* END tex2c speed upgrade *******************
* Replaced code segments with ClearUnder in 4 spell files.
* Replaced several code segments in .tex files with ClearUnder.
* All appropriate code segments have been replaced with ClearUnder now.
* Ok, now I did "smake newspell" and the filesize INCREASED from
1552980 to 1628116!!!!! There must be some difference between smake dev
and smake newspell.
* Replaced all appropriate code sequences with ClearVisbile
* I could not find any code sequences to replace with RestoreCell.
* Replaced all appropriate code sequences with BackUp.
* Above replacements were made to enhance readability and to make future
enhancements easier. Some future strange enhancemnt to the cell
structure can now be integrated into the game by just changing the
routines in core.tex. (theoretically).
* BUG: Wizard kills some creatures. Wizard mounts something. Mount dies
permanently. Wizard's vanquished foes info not copied into
cell.vanquished. FIXED by replacing a code sequence with
RestoreCellWizard in Reinstate.
* BUG: same as above but with collapsing meditations. FIXED by inserting
RestoreCellWizard into CollapseMeditation.
* BUG: Collapsing mediations does RestoreCellWizard on the wrong wizard,
with disasterous consequences. (another off by 1 error). FIXED.
* All appropriate code sequences replaced with RestoreCellWizard.
* I could not find any code sequences to replace with BackUpCellWizard.
* Inserted version information compatible with the AmigaDOS version command.
* Fixed the smake archive to archive the time and datestamp of the files.
This way I can cd to the graphics or spells directory and type:
list since friday
to see all the files that have been changed since last friday.
Or I can do:
list since 25-nov-97
to see all the files that you have added/changed since November 25th.
* Fixed the bug with pressing alt-o while already in the alt-o menu.
**************************************************************************
************************ ARTIFACTS UPGRADE *******************************
**************************************************************************
* Read the docs for complete instructions on Artifacts.
* New function: InsertArtifact.
* New predicate: isArtifact.
* New predicate: isUnderArtifact.
* New predicate: isUnderScroll.
* New predicate: isIDstatic.
* Artifacts added to alt-o level editor.
* Hidden Artifacts implemented.
* Now that I have implemented hidden artifacts and scrolls I find that I
cannot attack objects that belong to NOBODY. I'm not fixing this right
away so that I can play the game like this for a while and see what it is
like. The game does let me shoot objects belonging to NOBODY though.
NOW FIXED.
* Made numerous changes to Reinstate so that killing any object that is
covering a scroll or artifact does NOT destroy the scroll/artifact.
This mainly consisted of replacing InsertCreature/ClearUnder sequences
with RestoreCell/InsertCreature sequences. btw: I REALLY like the new
reinstate routine it is sooo much easier to understand than the old one!
* Also had to make changes to InsertCorpse to not destroy scrolls and
artifacts.
* New functions to support the above 2 items: InsertCreatureUnder and
InsertCorpseUnder.
In general, if a creature dies while on top of a scroll then the corpse
for the creature goes to the underpart and the scroll goes to the top part.
If an inanimate object dies which is covering a scroll or artifact then
the scroll/artifact is no longer destroyed but instead goes to the visible
part of the cell.
* Hidden scrolls and artifacts are now fully supported by core.tex.
You can now "dig up" buried scrolls and artifacts.
You can now have wars over a particular scroll, with one creature
moving onto the cell and being killed by another creature who is then
killed by yet another, ad infinitum and the scroll won't be destroyed.
* Made 2 fixes to move.tex to prevent Thundermare and Iridium
transformations from destroying scrolls underfoot.
* Set CAST_ARTIFACT on all appropriate magic spell files. At the moment
CAST_ARTIFACT is set only on spells that have CAST_LIVING set. All
spells which have CAST_LIVING set also have CAST_ARTIFACT set.
This way artifact creatures are treated just like any other creature
for purposes of spell-casting.
* Please don't forget to set CAST_ARTIFACT on any new magic spells that you
make (if needed). Most every spell that can be cast on creatures should
be castable on Artifacts also. (since artifacts are just a special type
of creature, like undeads are a special type of creature.)
As I was going through the spell files I noticed that Orcs is CAST_FREE?
And when you actually cast an Orcs spell it says at the bottom that the
range is 0 but in fact it is 1.
I added Artifacts to the game for the following primary reasons:
1) It adds the "Capturing Neutral Equipment" play-mechanic to the game.
2) It adds the "Capturing Enemy Installations" play-mechanic to the game.
3) Provides extra incentive to players to hold a particular position, as
opposed to hiding in the corner.
How good artifact gameplay actually is in real games will have to be
determined by playtesting. Although I note that when I added scrolls I
began doing crazy things that I wouldn't have otherwise done, such as
charging my wizard TOWARDS powerful enemy creatures (instead of AWAY as
usual) in order to grab a good scroll before they could get it.
**************************************************************************
********************** END ARTIFACTS UPGRADE *****************************
**************************************************************************
I just started up a test game to test all the new features and I started
out the game with a THUNDERMARE in my spell list.
A bipedal generator just generated a Brown Bear. But bears are quadrupeds
not bipeds. Shouldn't this be fixed?
Hmmm... Now I am playing a game with 4 generators... 2 of them are bipedal
generators. Bipedal Generator1 produced this sequence of monsters:
Derro, Derro, Bear, Bear.
Bipedal Generator2 produced this sequence of monsters: Halfling, Halfling,
Halfling, Halfling
*************** Scrolls Improvement Upgrade ****************
* Hidden Scrolls implemented.
* Inanimate objects can no longer pick up scrolls.
* Fixed spiders to use the InsertCreatureUnder function when laying webs.
* Changed spider description to say that it eats scrolls. (since the
act of laying a web destroys any scroll that may have been underneath it.)
* REMOVED the ChooseYourBonusSpell option from the setup screen II and just
set it to always be on. IMHO having it off is no fun so it should just
always be on. (and we've completely run out of room on setup screen II).
* Scroll delay implemented. So now it is _very_ possible to have wars over
scrolls. You can set the scroll delay to 3 turns and then you must take
the cell and HOLD it for 3 turns straight. If someone dislodges you from
the cell before 3 turns is up then you don't get the scroll and must retake
it and start over.
BUG: Ropers destroy whatever they are standing on when teleporting.
(corpses/scrolls/artifacts) Oops no it doesn't. When the roper teleports
it takes whatever it is standing on with it. Interesting.
* BUGS: Roper scrolls teleport, growth scrolls alter growth rates, Spider
scrolls lay webs, Haunt scrolls change sides, meditation scrolls
collapse, spriggan scrolls "take a kip". ALL FIXED NOW.
These bugs wouldn't have happened if scrolls were "dead". But perhaps
setting the deadbit on scrolls would cause other bugs? Who knows?
For now I have simply added an isScroll check to wherever I find bugs
related to scrolls. It is easy and it works.
************** End Scrolls Improvement Upgrade **************
* Replaced a couple of the old wizards[] references with Wizards[] in
core.tex.
* Replaced a couple of the old wizards[] references with Wizards[] in
cell.tex.
* Replaced several of the old wizards[] references with Wizards[] in
warp.tex.
* Replaced all wizards[] with Wizards[] in init.tex.
* core.tex, cell.tex, warp.tex, init.tex are now completely free of old
wizards[] references.
* Replaced all (except 1) of the old wizards[] references in predicate.tex.
* Replaced 2 of the old wizards[] references with Wizards[] in prog.tex.
***********************************************************************
********** Artificial Intelligence Spell Selection Upgrade ************
***********************************************************************
* I am seriously looking at spell.tex for the very first time.
* Improved computer spell selection by using ObeySpellCastingRules.
This should completely eliminate all the really stupid casts where the
wizard tries to cast an impossible spell due to there not being any legal
targets. (Such as casting Raise Dead when there are NO corpses in range.)
* BUGS: Computer wizards were cheating! They were going through their
ENTIRE spell list and casting any spell they wanted! And they were going
through their entire spell list and discarding any spell they wanted!
NOW FIXED BY changing max to min in the following line in
IntelligentComputerSpellSelect and ComputerSpellDiscard.
int look = max (LOOKAHEAD, Spells);
* ObeySpellCastingRules is now more sensibly known as isIllegalCast.
* New function: isStupidCast.
* Improved computer spell selection by using isStupidCast along with
isIllegalCast. Now if a wizard contemplates casting combat but his only
legal targets are enemy creatures or his own combat aerial servant he
will simply decide that casting combat in this situation would be stupid
and will cast something else instead.
* ADDED lots of extra checks for spells to probably not cast while double
or triple is in effect.
* ADDED complete stupidity checking regarding multiple wizard powerups.
* Having a working game load/save feature really helped me debug the AI the
last few days. Thanks Sean!
* FLAW: A computer wizard was in a tree. There were several legal targets
for the slow spell that he cast but unfortunately, all the targets were
already speed 1 so the spell was really wasted. NOW FIXED.
* SMALL FLAW: A computer wizard in a Dark Citadel just cast Speed on his
Floating Eye. I'm sure he had at least a few other spells that would
have been better. NOW FIXED.
* FLAW: A computer wizard cast Sanctuary on himself even though he
already had Recover Boost. (He had no creatures on the board). He
should have cast any one of a number of other better spells. NOW FIXED.
* Numerous other flawed spell selections fixed using the same method as
above. This new "look before you cast" strategy is really working out
nicely! The only strategy game that might be better than Chaos is
Chaos Coding.
If you notice a computer wizard casting a spell and then aborting it due to
no legal/nonstupid targets then please let me know. (or just fix it). It
should NEVER happen unless the creature he was planning to cast it on gets
killed before his casting phase. Or if his line of sight becomes blocked
(for example by another wizard casting lots of walls between him and the
intendend target.)
***********************************************************************
******* END Artificial Intelligence Spell Selection Upgrade ***********
***********************************************************************
BUG: I just surrounded a computer wizard with weak walls.
(He had already selected Lightning as his spell). When it became his
turn to cast he cast it on one of my weak walls. The
wall then had 83 life points. Please fix. Fixed by SAI.
***********************************************************************
*********************** Music System Upgrade **************************
***********************************************************************
* After ages of hacking and slashing music asm code I am now ready to
integrate the new music playback system into Chaos.
* Downloaded and installed util/pack/xpk_Develop.lha so I can assemble
player.asm -> player.o
New music system supports compressed music IF you have xpk libraries
installed; otherwise it doesn't. xpk libraries NOT required. It is
just an extra added option for someone who wants to replace the game
music with their own (compressed) music. Or perhaps we will use
compressed music at some point. Who knows?
Here is what I did with xpk:
Put the archive into t:
lha x #?
cd t:xpk_develop/include/c
copy all to include: clone
cd t:xpk_develop/include/asm
copy all to include: clone
cd t:xpk_develop/autodocs
copy all to include:autodocs clone
I didn't know where else to put the autodocs...
I have no particular plans for using xpk from C but you never can tell what
the future will hold so I installed the C files for completeness.
* Commented out EVERYTHING to do with the awful ptreplay.library.
* Music.lib
In preparation of the new music system I have joined 27 files into 1
music.lib file which contains all the asm code related to the new music
system. (12 .asm files, 12 .o files and 3 .i files.) All those files must
reside in INCLUDE: in order to assemble correctly and since I don't feel
like reading the instructions to figure out how to make them assemble from
any directory it is just easier to assemble them like that and then whack
them all into one big 32k music.lib which can be easily included in the
archive.
* Chaos is currently 1100836 bytes. After linking with the new music
system it is now 1100836 bytes! Either slink is much better or much
worse than I thought it was! I just linked with the 32k music.lib and
either slink didn't do it or it noticed that there are are NO calls to
any functions in the .lib file currently so it intentionally didn't
include it. Yes that must be it.
* In a frantic attempt to get ciab.resource to open (it always failed) I
commented out all the timing code from Chaos. Still didn't work. Ok,
now I figured it out. A damn misplaced semicolon...
Ok I just tried to link in the music.lib while actually referencing 1
variable from music.lib and I just got TONS of undefined variable errors.
Looks like I must do a LOT more hacking and slashing.
Ok I've reduced it from 46 errors to 25. This is the first time it has
actually compiled into a file:
1099680 -> 1125768 bytes so it seems to have only added 26k. WOW, if
that value holds then that is EXCELLENT! Much better than the 40k I
thought it was going to be!
Details of what I did to force the new music system into Chaos appear in
the file INCLUDE:errorlistmusic. (2.6k) and more info is in the asm
source player.asm
* WOOHOO! Successfull linkage of music.lib with Chaos achieved on
Sunday, December 14th, 1997. That was just to get it all linked
together. I haven't put any code in Chaos to actually call any of the
routines in music.lib yet so there is still much to do.
* ROUTINES in music.lib:
*** setsong - Start playing a different song in the current module
* d0 = Song number to start playing
*** loadmod - Load a module without playing it
* a0 = Pointer to filename
* Returns: d0 = Null if successful, pointer to error message if failed
*** playmod - Play an already-loaded module
* d0 = Song number (-1 = user's choice)
* Returns: d0 = Null if successful, pointer to error message if failed
*** startmod - Load a module and start it playing
* a0 = Pointer to filename
* d0 = Song number (-1 = user's choice)
* Returns: d0 = Null if successful, pointer to error message if failed
*** contmod - Continue a module from where it left off
* Returns: d0 = Null if successful, error message if failed
*** contplaymod - Continue current module if possible, otherwise restart it
* Returns: d0 = Null if successful, error message if failed
*** stopmod - Stop a playing module
* Returns: d0 = NULL
*** endmod - Stop and unload a module
* Returns: d0 = NULL
There are other routines for changing playback speed and volume but I
haven't worked out how to use them yet.
So all we need for the intro music is
startmod("filename",0);
// blah blah blah
endmod();
YAY! IT REALLY WORKS!!!
2 small problems though:
1) The current sound effects system opens up and
hogs 1 audio channel throughout the entire game. If it does this while
the music is playing then it messes up the music. I worked around this
by moving the code that opens the audio.device and hogs the channel so
that it is no longer in CommenceChaos but rather right at the end of the
setupscreens.
2) It is incompatible with Say(); calling Say while
music is playing screws up the timing of the music and makes it sound
awful. However, playing a sampled sound during the music does WORK
PERFECTLY! So we must either:
A) Not play music while using Say();
B) Not use Say(); while playing music.
C) Make some sort of workaround for Say(); However I have no idea how
to approach the idea of making a workaround. I guess Say messes up
the CIA timing registers? Perhaps the AmigaSpeech just plain isn't
truly system friendly? Who knows?
For now I will comment out the line that says "Welcome to the Magic Zone"
so that the music can play during the setup screens. It will be a simple
matter to replace this Say(); with an actual sampled sound file. (Something
I've been planning to do for months anyway).
Actually it could be WaitForSay(); that causes the incompatability for
all I know.
* 218K of asm source code was used to produce music.lib.
Now that the new music system is _finally_ in and working:
* ADVANTAGES of new music system vs. ptreplay.library.
1. It actually works.
2. It works on MC68000 processors unlike ptreplay.library.
3. It can play SoundTracker/NoiseTracker/MutantTracker/ProTracker music
without messing them up like ptreplay.library did.
4. Also supports 8-channel Oktalyzer music. (untested at this time)
ptreplay.library has no 8-channel support.
5. It has a rudimentary IFF 8SVX sound sample play routine also.
6. It was originally written by my good buddy Bryan Ford the MEGACODER.
7. It is very easy to add med/octamed support should we decide to do so.
8. It is very easy to add support for a BUNCH of other music formats but
those other formats are all irrelevant AFAIK.
9. MOST IMPORTANTLY: It _shares_ the sound channels in a system friendly
manner!!! Something that _NO_ other replay routine does!!! (That I
know of or could find any evidence of or have even heard of.)
Sharing the sound channels _may_ be desirable in the general game so
that music can be playing while the sound effects are playing too.
However this may sound too jarring with multiple sound effects being
played. Only experimentation will tell.
Sharing the sound channels _IS_ _DEFINITELY_ required for a truly
system friendly and multitasking game. If the player routine doesn't
share the channels then the AmigaOS DisplayBeep(); function CANNOT
make any sound! This is unacceptable IMHO. Especially when you are
sorting your database or copying a disk or browsing the web while
the game music is going on.
I investigated many, many replay routines and NONE of them shared the
sound channels. They all just hogged all 4 channels and wouldn't let
any other sounds get through no matter how important the sound was!
* DISADVANTAGES of new music system vs. ptreplay.library.
1. Takes 26k instead of only 10k.
2. It might be a LOT slower. I just don't know. We need to somehow test
its speed by running a program and timing it then running the same
program again with the music going and see if there is a speed
difference.
3. It isn't a shared library so it can't be flushed out in a low memory
situation.
4. It doesn't have volume fade in/out because I haven't got around to
implementing that yet. This isn't really a disadvantage though since
the volume fade in/out of ptreplay.library caused crashes anyway.
* DELETED all code related to ptreplay.library.
* In the future I might remove the 8-channel music support if we don't end
up using my 8-channel music or if the 8-channel playback doesn't work 100%
That would save several K.
* In the future I might add volume fading in/out.
* All in all, Chaos now has a better music playback system than any other
Amiga game. Most games have an option for music OR sound effects but
Chaos can have BOTH if we so desire.
* AAAUUUUGGHH!!!! I just did a DisplayBeep during the music and the music
PERMANENTLY lost a sound channel!! It also caused some other glitches in
the music playback. I don't understand this. I can play sampled sounds
all day long from the CLI and everything works perfectly... I don't know
why this music system is not cooperating with DisplayBeep and Say.
Ok, I changed my preferences: I changed the sound type from "beep" to
"sound sample" now the display beep makes NO noise and doesn't steal a
channel. !?!?! For "beep" to make a sound and "sound sample" to not
make a sound in DisplayBeep means that there must be a bug in the OS.
This whole situation also means that there must be some secret coding
technique that is used in the way I play my sound samples from the CLI
that allows it to borrow a sound channel, use it and then give it back
without causing any damage. This will all require a lot more
investigation.
***********************************************************************
******************** END Music System Upgrade *************************
***********************************************************************
BUG? I was playing a nice little game... I had surrounded a bipedal
generator except for 1 cell. I just cast a faun into that cell. Then it
said "Banderlog sleep" and my Red Dragon was put to sleep and instantly
collapsed! ARGH! There are no banderlog's on the screen! Could my Faun
have cast sleep on my own creature?
The exact same thing just happened again! This time my gorilla got put to
sleep! I think maybe I am casting creatures onto a dead banderlog.
Now I'm in a completely different situation and my Faun just put my harpy
to sleep. This faun has killed more of my creatures than the enemy has.
Now my other faun on the other side of the board put my manticore to sleep.
I guess Fauns just cast their sleep spell on anybody...
Now my faun put my Crocodile to sleep.
I had always intended that you press the "c" / "r" / "s" / "m" keys ONCE
and the color cycling would take care of the flashing for you. But I just
now accidentally held the "c" key down for a while and it started flashing
completely on/off in an almost acceptable manner.
***********************************************************************
**************** Efficiency Upgrade Speed/Memory **********************
***********************************************************************
********************** Part 1 ****************************
********************** __near data upgrade ****************************
* SOLUTION to near/far data problem. There is no problem! The compiler
defaults to always using FAR data. But this is easily overridden by
using the __near keyword on any varibles that we want to keep in the near
64k dataspace. Keep in mind that some vars are accessed in the asm code
as FAR so we have to leave those as FAR (or add the __near keyword AND
edit the asm code). So if you ever have a variable that gets used a lot
then feel free to use the __near keyword on it.
* As a test I will just make board be a __near variable.
1126496 -> 1123868 Cool! Saved 2628 bytes! This savings should
translate at a 3:1 ratio so that's about 876 bytes saved on smake
release. Don't forget __near variables are faster too.
* More C lameness: I just moved a bunch of variables from far to near in
prog.tex. I only recompiled prog.tex and start.tex to quickly eliminate
the simple errors. Yet it compiled and linked perfectly!!! Even though
there were TONS of far references to variables that were now defined and
initialized as being in the __near data section! I couldn't believe my
eyes! I knew there was NO way such a program could possibly run but I
wanted to prove it so I ran this newly compiled Chaos and sure enough
*BOOM*. Up came the requester: "Software failure: Suspend or Reboot".
* After switching over all appropriate variables in prog.tex from far to
near: The filesize is now 1113932 for a total savings of 12564 bytes.
* Ok, I rummaged around through all the other .tex files and transferred
over a few variables here and there to __near. Even changed vp in the
C and asm code to be near. Filesize is now
1112396 325868
* Changed vp to be near (in asm code too). DID NOT WORK no matter what I
did. 8(
* __near vs. __far
4 6 Bytes of code required to access the variable.
12 16 Cycles required to access byte or word variable on 68000.
16 20 Cycles required to access long variable on 68000.
move.l var(a4),d0 Asm near var.
move.l var,d0 Asm far var.
GRAND TOTAL SAVINGS: 14100 bytes.
******************* END __near data upgrade ***************************
********************** Part 2 ****************************
********************** Macros Upgrade ****************************
int t3=board[c].char_stat.Stat; Produces the following asm code:
move.l d4,d0 ; 4 cycles
asl.l #2,d0 ; 12 cycles
sub.l d4,d0 ; 6 cycles
asl.l #2,d0 ; 12 cycles
sub.l d4,d0 ; 6 cycles
asl.l #3,d0 ; 14 cycles
movea.l a0,a1 ; 4 cycles
adda.l d0,a1 ; 6 cycles
move.l 0014(a1),0018(a7) ; 28 cycles
GRAND TOTAL CYCLES: ; 92 cycles
GRAND TOTAL BYTES : ; 22 bytes
The above code is actually much smaller and faster than I expected.
Now look at the code generated by:
int t4=cell->char_stat.Stat;
move.l 0014(a5),0014(a7) ; 28 cycles. 3.28x faster than above!
; 6 bytes.
So we can basically save 16 bytes and 64 cycles each time we use a new
IsUndead(cell) macro instead of an old isUndead(cell) macro.
* NEW PROGRAMMING RULE: macros which start with a lowercase letter
(isUndead) require a numerical parameter while macros that start with an
uppercase letter (IsUndead) require a pointer to a playCell structure.
* Changed: AttacksLiving into attacksLiving and AttacksUndead into
attacksUndead.
* All "is" macros now also have an "Is" form in predicate.tex.
At the beginning of this project the size of Chaos is:
1112396 / 325868 bytes.
* CHANGED isFlying from a function into a macro.
1112208 / 325844 Saved 24 bytes.
* Made "Is" versions of "is" functions in predicate.tex plus optimized the
"is" functions.
1112572 / 325904 Lost 60 bytes but saved 64/128 cycles here and there.
* Edited spell.tex:
1112620 / 325804 Saved 100 bytes.
* Edited cast.tex:
1112568 / 325664 Saved 140 bytes in isIllegalCast
1112020 / 325004 Saved 660 bytes in isStupidCast
1111888 / 324800 Saved 204 bytes in DoComputerCast
1111832 / 324672 Saved 128 bytes in Drainer
1111796 / 324560 Saved 112 bytes in PlasmaBeamHandler
1111804 / 324536 Saved 24 bytes in Multiplicity
1111728 / 324432 Saved 104 bytes in CastSpells
1111732 / 324432 Saved 000 bytes in PossibleChoice ???
1111716 / 324400 Saved 32 bytes in Generate
TOTAL SAVED cast.tex 1404 bytes.
* "c" key is faster now that spell.tex and cast.tex have been optimized.
* Edited cell.tex (ReDrawCell + AutoAccept)
1111684 / 324288 Saved 112 bytes.
* Edited prog.tex:
1111588 / 323316 Saved 972 bytes by removing AnColBackup and AnRowBackup.
1111088 / 322828 Saved 488 bytes in Animator.
1110600 / 322444 Saved 384 bytes in HandleIDCMP.
1110608 / 322428 Saved 16 bytes in HandleMOUSEMOVE.
1110556 / 322352 Saved 76 bytes in GetSpellSelection1.
1110076 / 321924 Saved 428 bytes in BoardUpdate.
1109988 / 321816 Saved 108 bytes in CalculateArtifactOwners.
1109900 / 321712 Saved 104 bytes in PickUpScrolls.
1109908 / 321704 Saved 8 bytes in main.
TOTAL SAVED prog.tex 2584 bytes.
* Edited info.tex:
1109592 / 321320 Saved 384 bytes in ExtraDisplay.
1108544 / 320380 Saved 940 bytes in InformationPanel1.
TOTAL SAVED info.tex 1324 bytes.
Running out of time. SI needs new archive by Dec. 22nd so the "Efficiency
Upgrade" is being placed on hold for now.
****** TEMP END of Efficiency Upgrade Speed/Memory ***************
* Absorbed flashywin.c into Chaos. Only added about 400 bytes to the
executable release.
* Quadrascope and Spectrogram added to the setup screens to go along with
the music.
After some hacking and slashing and rearranging I got everything to work
and be compatible with the quadrascope and spectrogram. I had to make
some adjustments to the GameGadgets code and rearrange some things and
add some lines of code here and there.
* #define CheckPixelArrays(blah) Saved about 1000 bytes.
* Set nasty_audio for the music player to prevent displaybeep from
permanently stealing a channel when you overflow a text entry gadget.
* BUG: When a creature is engaged it can still "attack" an empty cell and
move onto it. NOW FIXED for human players. This bug may still exist
for computer players.
BUGS: load and quit don't work on setup screen I. No time to fix.
I don't really know how to fix them quickly because part of the problem is
adding gadgets that are already there or removing gadgets that are not
there. I don't know much about gadgets so I won't muck about with this
now. Just remember that the GameGadgets need to NOT be attached to window
during the setup screens but they DO need to be attached to the window
during the entire rest of the game.
* I made a smake release and tested it on my A2000 and disabled the chipram
down to 512k to see if it would work. IT DID!!! AMIGA RULES!!!
On a 1 meg Amiga with 512k chipram and 512 fastram here is the memory
availability when the game is autobooted from a minimal boot disk with NO
unneccessary stuff loaded and making use of the wonderful Add36k command.
This is while running chaos with a standard stack of 4096 bytes.
I wouldn't recommend using a stack bigger than 8000.
btw: The disk is 94% full.
Time: Chipram Available: Fastram Available:
Intro 47496 55920
Setup 56376 111592
Game 205304 111320 (Examined while "about" screen was up.
Game 256104 111320 (Just looking at the board.)
The numbers for the Intro and Setup seem dangerously low to me. It would
only take *1* piece of fragmentation to cause them to fail. Indeed, it
seems like a miracle that it is working. Maybe its a Christmas Miracle?
I just can't imagine any W95 program running with only 55k of free ram
and not crashing after 5 minutes or so.
I noticed that the whole game sounds different on the slower 7Mhz 68000.
The lineofsight routine is still too slow on 7Mhz 68000 as can be seen
by the delay in pressing the "c" key when trying to cast something with
long range that requires line of sight. (Like trees or castles).
Oh well, nothing can be done about that.
Sending an archive to SAI on Sunday December 21, 1997 for testing during
Christmas holidays. Also sending an archive of my autobooting floppydisk
version for OS1.3 Amigas.
-------------------
* Adjusted alignment of scopes to allow them to run a bit faster.
Saves 64 chipram reads and 64 chipram writes per frame drawn per scope.
* Rewrote the quadrascopes to run at 3x the framerate that they were running
previously. They now run at MAXIMUM speed (50 fps). Quadrascopes are
now much more "electric".
* Rewrote the spectrogram to run at 3x the framerate that it was running
previously. It now runs at MAXIMUM speed (50 fps). Also rewrote the
\decspec routine in flash.asm to be much faster. The spectrogram now
descends much more smoothly. (1 pixel per frame instead of 3 pixels at
once every 3rd frame.)
* Implemented a new jcspectrogram. It is a new version of the above
spectrogram but this one has colors and is faster too. I left the old
spectrogram intact in music.lib in case we want to use it in the future
for some reason.
* Rewrote intflashnote in misca.asm to be faster and take less memory.
* Commented out most of the unused variables from misca.asm. SAVED 1808
bytes on the music.lib filesize.
* Rewrote part of the Quadrascope to save 66,800 cycles per second on A500.
Christmas Eve playtesting with Joseph:
* BUG: Artifact ties were being awarded to the higher player number rather
than to NOBODY. NOW FIXED.
My brothers had not playtested Chaos in months. They had completely lost
interest in the game. Joseph even explicitly said that "I just don't have
the attention span required to play Chaos." I thought that they would
never play it again... 8(
But I got Joseph to notice the game when he came into the room while I was
working on the speeded up Quadrascope so we got to talking about the new
features and within an hour of playing he was telling Jerry he should start
playing the game again because the "The game is really groovy now."
Joe and I played 2 games with about 20 hidden artifacts + 20 hidden scrolls
each. The first game we had only 20 spells and the next one we had 40 spells.
We had 3 or 4 generators and a few computer players against us. The game
had a whole different flavor as we went around mining for spells and
learning how to use artifacts. We played where only wizards could pick up
spells. I liked that a lot.
JJ and I played 2 games with 99 spells, Texas Trash'em, 20 UNhidden scrolls
and 20 UNhidden artifacts. I was near death from turn 1 due to being near
too many enemy artifacts and generators but luckily I cast a Reflector
which set me up in a good safe position. The game would have probably
lasted a very long time but JJ made a fatal mistake. He took control of a
Damaged Dalek Artifact and shot my wizard (thinking he would kill me).
Of course the FULL brunt of the impact reflected back on the Dalek and it
died. So there was this dead dalek just laying there so I cast Raise Dead
on it and started chasing after his Wizard and killed him. Game over man.
The next game was INCREDIBLY interesting... The top 2 corners had simply
too many Computer Wizards and generators to venture near. That left the
bottom right corner which was quite safe and quite devoid of usefull
scrolls and artifacts. And the bottom left corner which had a Range Boost
Scroll and a Double Scroll and 2 Bolter Wall artifacts with NO generators
or enemy wizards nearby.
First turn:
I cast a pegasus so I could get over to the corner ASAP. That
was my fastest creature. I didn't have a teleport.
JJ cast Teleport and was IMMEDIATELY in a GREAT position in the bottom left
corner.
I dediced "Damn the bolter walls! Full speed ahead.
Turn 2: I get shot by the bolter wall which JJ now controls but I
psychotically decide not to retreat.
Turn 3: I move my pegasus as close to the botom left corner as possible.
Which is still 2 squares away from the bolter wall. I get shot by the
bolter wall again AND some other guy's dragon breathes on me and kills my
Pegasus. So my wizard is just standing there exposed.
Turn 4: I cast a creature next to the bolter wall and made it back to being
nobody's.
I don't remember the exact way things happened from there on out but all I
know is that each individual turn I was in SEVERE danger of dying. I had
to cast the EXACT right spell in the exact right way to survive. It was an
enormous power struggle for control of that corner. Each turn I ALMOST got
the upper hand and became powerful but each turn my plans were thwarted by
JJ. At one point I had my wizard and elephant next to the bolter wall so it
was GOING to become mine after we cast spells. This means I was going to
win (bolter wall hit plus elephant hit on his wizard = death) But then he
gave up fighting for the artifact and cast brain drain on it. I was sorely
tempted to cast Raise Dead on it but *I* was also about to die immediately
so I couldn't.
He cast a lion to go around my elephant and eat my wizard so I HAD to
cast sleep on the lion right that turn. Problem solved, except that he
cast FREE on my elephant!!!! ARGH!!!! Then he woke up his Lion!!! I had
just finally cast cloak but after all the attacks that round even with my
cloak I was down to 2 points of life. So I had to retreat back to the
middle of the board which was basically empty except for a bolter wall
artifact and a dalek artifact. Once I quit psychotically trying to attack
that corner I became quite powerful. Instead of just trying to survive from
one turn to the next in a defensive manner I was able to concentrate on
trying to do something more offensive in nature. hehehehe Like I cast a
wall spell around his wizard and boxed him in on the side of the screen and
made him abort his undead creature! hehehehe. Then the FREED elephant
killed his lion and an enemy bear has wandered into the corner so he is now
in an interesting position. By then it was 1:00 A.M. so we saved the game
and he went to bed.
I would NEVER have played so agressively in the olden days. But all that
kewl stuff in the corner activated the "greed factor" in us so we all went
there to fight over it.
Christmas day playtesting with Jerry, Joseph and JJ.
* BUG: Inanimate objects are exerting influence on artifacts. NOW FIXED.
* BUG: Joe cast Magic Bolt on a web and it increased the web's life to 33
points or something. Now REALLY fixed.
* BUG: I cast a Magic Bolt on a freshly generated skeleton. The skeleton
then had 25 life points! Now REALLY fixed.
BUG: computer wizard cast dark citadel several squares away.
BUG: computer wizard cast alliance and nothing happened. Maybe he aborted
it?
Ok, I'm home now and looking at the bolt bug. The *= -MSF fix is there in
the spell file. (I put it in the day you gave it to me.) But SOMEHOW it
is not in castmagic.c!!!!!!! ARGH!!!!!!!!!!!!!! Hmmm... I could have
sworn I did a smake clean before I did smake release.... I guess maybe
smake clean doesn't rebuild the castmagic.c.... The date on castmagic.c is
December 5th!!! oh well... I am doing a smake newspell now, then a
smake release then we will playtest some more.
Re: new font. I noticed that the fancy font was much easier to read on my
old Amiga 1084S monitor when I was testing the 1 meg version. Something
about the fuzziness smooths it out or something.
BTW: We were all gathered around for Christmas dinner with jillions of
relatives and my dad asked me "Why can't I read the letters on my screen?"
He said he thought something was wrong with his computer or monitor.
Admittedly my dad has serious vision problems. His eyesight was HORRIBLE
but then he had corrective laser surgery done twice and his vision is much
better now. He still wears contact lenses but they are many times less
powerful than his old ones. As a quick fix I am disabling the fancy font.
Feel free to add a menu option for "Fancy Fonts" on the drop down menus if
you so desire. He was using a 1084S monitor when he registered his
complaint.
Joe wants auto-switching with numeric keys.
Joe wants number of kills on score screen.
Joe is dying for the graphics upgrade to be implemented.
* Edited some spell descriptions and removed spell-casting ability from
Faun because I really hated it and couldn't stand it any longer.
* Played more games of Chaos with relatives. One of which I REALLY wish
I'd saved on turn 1. It was so incredibly strategic! As it turned out,
each individual player had to cast exactly the right spell in exactly the
right spot for several turns or they would die. It was AWESOME! Totally
cool! Hopefully I will make a level like that someday. (Only really
works with exactly 3 players though.) I ended up dying after several
turns all because I cast the wrong spell on turn 2.
* FLAW: Wizards kept subverting/abducting/betraying artifacts. NOW FIXED.
* Changed: Bipedal generators no longer produce bears.
* Changed: Moved end-of-turn gadget to be FAR away from question mark
gadget. My entire family has been bugging me about this for years. Every
time we play they say "That shouldn't be there next to the question mark."
* Implemented jcquadragram (jcquadspectrogram). I've always wanted to do a
seperate spectrogram for each of the 4 sound channels for many, many
years. I've always wanted to watch the different notes of the same
instrument "dance" as they play. Only now that I have finally done it,
it doesn't seem quite as cool as I had hoped. Oh well, maybe others
will have a different opinion.
* JCquadspectrogram has 32-note resolution. The original spectrogram and
jcspectrogram had only 16-note resolution. In spite of the increased
resolution it is still about the same speed as the original jcspectrogram
due to the fact that it caches pixels in a register and then writes out
whole words at a time to chipram instead of 1 byte at a time.
* l key for line of sight. It works like the other keypresses execpt that
this one simply shows all the cells that can be seen from the current cell.
This is very useful if you are thinking of casting a certain spell that
needs line-of-sight and you want to be sure that you have it. Simply
place the mouse pointer over your wizard and press "l" to see all the
cells that he has line-of-sight into.
* Fixed it so that the game startup after setup screen II doesn't look so
bad on slow machines.
SCREWEY BUG: The game has been working great for ages. But suddenly,
every time I do a smake release the game crashes on setup screen I. Yet if
I do smake clean smake dev it works fine. But then I do smake clean smake
release and it crashes on setup screen I. I can do a smake release and
then ONLY recompile init.tex as smake dev and everything works fine.
Totally strange. What could be causing this???
* Ok I've worked around it by forcing init.tex to NOT compile with the
"optimize" option. Now everything is working perfectly again.
* The line of sight testing was just too slow on A500 so I rewrote
isLineOfSight to burn up some memory but be 25% faster than before.
Joseph tried to design a level with your level editor but it went bonkers
when he tried to insert the wizards.
* EGADS! I was looking around through the Protracker Replayer Asm code,
trying to figure out how to implement my new instrument-flasher when I
became aware of the fact that the internal data format and file format
for protracker mods is horribly lame! For example, the instrument #'s
are stored as a byte. But the upper 4 bits of the byte are stored as
the upper 4 bits of byte 1 and the lower 4 bits of the byte are stored as
the upper 4 bits of byte 3. So all this anding, shifting and oring crap
has to be done. The net result is that the act of getting the current
instrument number takes 7 machine instructions instead of 1 like it
should. YICK! Oh well, at least I optimized it to now take only 6
instructions.
* Due to the lame data format there are about 50 stupid anding instructions
in the ptsplay asm code that wouldn't be needed if the file format made
sense. However I have now optimized the code and eliminated 4 of them,
saving 16 bytes and some cycles.
But to eliminate the others would require a whole new file format.
I noticed there were many other optimizations that I could do but I would
need to use a temp register to implement them and I am unsure if it is safe
to do so in those routines. Maybe I'll investigate it later.
* The archive was too big to fit on 1 720k floppy so I deleted the music
from the archive. The music has never changed since the day I first put
it in anyway. So for now the music/ dir won't be passed back and forth
in the archive.
***********************************************************************
************************* 1 Year Overview *****************************
Well it is now Jan 6th, 1998. I have been coding on Chaos for 1 year now.
We have acheived quite a lot during this time:
1) Numerous bug fixes
2) Numerous new features
3) Numerous new spells
4) Numerous code optimizations
5) I ended up adding over 256K of asm source to the game, quite a bit more
than I originally planned, with lots more on the drawing board.
The readme file of all the improvements is over 158K
I noticed back in October, 1997 that my C coding speed had noticeably
increased to the point that I could code in C just as well as asm.
There is still an AWFUL lot more work to do, but all in all it has been a
year filled with great achievments. Keep up the good work.
*************************************************************************
JC: ReleaseSemaphore
Chaos readme (cont.)
====================
This file continues Readme.1997
BEGIN: Chaos 2.2
SAI: Xmas report extracts follow
There are numerous bugs that we discovered. Some of them are to
be expected, some you will already know about, others are probably
better fixed by me. However, I'll list them all down along with
some other comments.
* The spell selection by computer players was notably slower on the
A500 (this is your new regime of spell selection). However, the
real problem here was that there was not enough on screen indication
of what was happening. NOW FIXED
* Somehow there was a sleeping neo-otuygh which was not redrawn.
* Somehow there was a sleeping ogre-mage that was still animated.
* Blob grows over earthquake, not sure if I like this or not.
* The team scores were still not correctly sorted.
* Several times players shot there own "hidden horrors" to reveal
the red dragon. I think the probability of the hidden horror needs
to be reduced below that of the red dragon. NOW FIXED
* The game locks up on the A500 when starting a new game after the
completion on the previous game. The only seems to happen when there
are lots of wizards. It can also be avoided by starting a new game
from the menu before the game ends naturally. I am assuming that this
situation is because memory is tight. NOW FIXED
BUGS:
* The teleport explode effect is applied to the wrong player. NOW FIXED
* The boil explode effect is applied to fire rather than water. NOW FIXED
* The initial set up was the same every time the program was loaded. NOW FIXED
* If you set the number of turns to "n" you actually get "n+1" turns. NOW FIXED
* Computer wizards and not conforming to the rules regarding the
necropotence spell and discard spell. NOW FIXED
* Cast agents have an off by one error. Best seen by the Faun casting
sleep on his own side. This is probably an improper wizards[]
reference. NOW FIXED
* Dad pressed the end-turn gadget in an attempt to cancel a spell. Instead
it tried to cast the creature to some location off the bottom of the
screen. NOW FIXED (end of turn ghosted during casting)
* There is insufficient information given to the player indicating
the pick up of a scroll. NOW FIXED (there is a text message and
an audio effect)
* Casting Biohazard gave all scrolls recovery -1 and they subsequently
all died in the next round. NOW ALLEGEDLY FIXED
* Flying creatures still show wings cursor even when engaged. NOW FIXED
* I cast a Meddle causing the nightmare I was mounted to become a skeleton
(i.e. I should now have been mounted on a skeleton); but when I moved the
skeleton my wizard was not moved. I think this means I need to check the
"mounted" bit carefully when doing reincarnation. ALLEGEDLY FIXED
* There was a radioactive land scroll. Human players creatures died on
trying to enter that cell (which is what is supposed to happen with
radioactive land), however, an independent crocodile merely walked
onto it. I've yet to check if they are immune from radioactive land
in more general circumstances. VERIFIED THIS PROBLEM IS MORE GENERAL
THAN I HAD ORIGINAL THOUGHT. Also affects pits. I'm leaving this for
the moment pending a bigger revision of computer movement to allow for
"eats" and "loathes" and the option of not moving at all.
* After high-lighting all your creations you need to click end-of-turn
twice if you decide to end while high-lighted. This can happen quite
often if you just want to check you have moved everything before ending
your turn. THIS DIDN'T HAPPEN ON MY COMPUTER -- DID YOU FIX THIS?
COMMENTS:
* Callum suggested the horn on the Abath should swing.
* Glen pointed out that the archery spell description does not actually
say what the spell does, although he guessed correctly. NOW FIXED.
* Computer players seem to make excessive use of Justice type spells
early in the game, leaving them short on powerful spells later in
the game. We often found ourselves holding back our styrong creatures
for the first five rounds until the computer players exhausted there
supply of justice spells.
* Computer wizard no longer casts castles close to wizard. (I originally
had code forcing wizards to cast castles adjacent to the wizards, but
I guess you deleted that in making the routines the same -- perhaps
we need to build a little more intelligence here).
--JC Reply: I didn't delete the code. It was still there all this time;
it just no longer had any effect in the new system. All has been FIXED
now. 8)
* Computer wizards make no attempt to collect scrolls (to the extent
that they will even get off a scroll if already standing on one).
* Glen wanted scrolls to appear slowly (something like one a turn,
rather than having them all on the screen at the outset).
* Callum wanted "RETURN" to mean end-of-turn. NOW FIXED
* Callum wanted a key exit from the info panels, he would most like
"q" to start the panel, and then another "q" to exit from it.
* Callum suggested the right hand set of bars on the info pages be
labelled "Recovery" at the top. NOW FIXED
* Dad didn't like the way that "Abduction" chose growths rather than
real creatures.
More changes:
* Fixed a bug with Repulsion which could leave the colours permanently
screwed up.
* Made isStupidCast compliant with agent casting.
* Made menu option for script font on info screens.
* Made menu option for agent casting.
========= Beginning of computer movement upgrade =========
Phase 1: Elimination of GetPlainWeight in cmove.tex.
The function GetPlainWeight is a major bottleneck in the calculation
of computer movement since it is called approx. 8n times for each
creature to be moved where n is the board size, flying movement
requires considerable more calls than this. Further, in a previous
effort to improve speed this is *really* only done once for each
player per turn, but the games plays better if it is done properly;
and this is the only way to implement "eats" and "loathes" properly.
A quick look at GetPlainWeight reveals that despite the large number
of conditionals most objects return a unique value. There I have
added a new tag "Weight" to the spell manager to store the values that
this function should return. If the tag is not given for a particular
spell, then its value defaults to "Life" as indicated by the function
GetPlainWeight. I have already added the tag to the appropriate spell
files. Another benefit is we will be able to modify behavious on a
level by level basis and have much finer control over computer movement
than was previously possible.
Well on the subject of crude approximation, note that the current
flying movement only considers ranges of one of the creature's
maximum (in the past it has been far too slow to do this properly!)
YEP, IT USED TO BE WAY TOO SLOW DOING THIS PROPERLY.
Also due to an oversight it is impossible for a computer controlled
creature to decide not to move if already well positioned.
The majority of GetPlainWeight can now be eliminated. Hence it is
better inlined inside CalculateWeights. Hence GetPlainWeight is now
completely deprecated and has been deleted.
Note that the corresponding function GetWizardWeight is called a maximum
of about 64 times in a round and hence is not at this time worth
modification. I think we can tolerate a slight delay in the movement of
wizards, they are after all supposed to be erudite fellows.
The above has taken care of all the checks except isDead, isAsleep, and
isTOwned. By modifying some basic functions in core.tex the isDead and
isAsleep checks can also be eliminated. Thus, the only problematic case
is isTOwned and since the same table of numbers must be used by all players
there is no way of circumventing this difficulty. However, we have suceeded
in reducing 7 conditionals (some with complicated predicates) to a single
conditional and a table lookup. However, this will eventually increase by
two conditions when "eats" and "loathes" are implemented.
Since CalculateWeights was only used in one place and there is no longer
any advantage in its precomputation I have eliminated it. This is made it
much easier to implement "eats" and "loathes".
Two constants control the strength of the "eats" and "loathes" effect and
these may need to be fiddled with to find nice values. The loathing effect
is in theory strong enough that a creature would prefer to jump into a pit
or walk on radioactives (but of course in practice a creature would just
sidle away from both).
Stopped the computer from moved onto nuked squares. Allowed computer
creatures to decide the best option is not to move.
Computer wizards now move towards and stay on scrolls.
============== end of computer movement upgrade ================
* Added Turns, Dread Elf, Dagger, Gravity, Demonic Touch
* Added secret power up WoodElf->DreadElf (make 5 kills with wood elf)
* Added gravity to information display.
* Fixed FileIO to save gravity information.
* Changed [] in print statements to () (to work with script font)
* Classic mode no longer default mode for DEVELOPER
* Fixed end-of-game bug that caused lockups. Still haven't fixed
the quit bug.
* Allegedly completed implementation of Volcano.
* Added two new generators: one for birds, one for dragons.
* Improved the loading and saving of the probability table.
* FIXED at last the ReleaseSemaphore problem when quiting the game.
* Improved Spell Manager documentation.
* Modified InsertCreature to handle player=ASLEEP properly.
* Made fake wizards actually capable of spell casting.
* Allowed combat on movement rating (see Arctic Wolf).
* Added: Arctic Wolf, Virtue, Shadow City, Basilisk, Achiyalabopa,
and Paradigm Shift.
* Added function AddSpecificSpell() to spell.tex (thus you can
now give a player a particular spell when desired).
* Added noddy basic program "sayer" to archive.
* Made <RETURN> equivalent to end-of-turn. Problem: holding down return
will cause multiple player to have end-of-turn. To overcome this I
have put in a delay, but this is a rather weak solution. If only there
was a RAWKEYUP IDCMP event this would be easy to fix, but I couldn't
find anything in the docs about doing this.
* Replaced $ in chaos.font with a bullet.
* Improved the image for the Nuke spell.
* Improved the image for the Lightning spell.
* Stopped display of Nothing spells.
* Added: Animate, Ball Lightning, Shocker, Basalt Golem, Emerald Dragon,
Willy, Glass, Battle Cry, Coercion, Confidence, Eye for an Eye,
Torment, and Materialize.
* Made the secret powerup GreenDragon->EmeraldDragon.
* Implemented Eye-for-an-Eye in combat routines.
* Changed io.tex to take account of changes in Wizards structure.
* Changed info.tex to display new powerups.
* Fixed a small problem in the intro sequence where "Wizards" and "Webs"
were printed multiple times.
* Made the lmkfile say "Compilation Complete" at the end, so I can do
something else while waiting for a recompile.
* Made a small change to BoardNormalize for speed.
* Moved multiplicity information from cast.tex into the spell files using a
new tag multiplicity. While I was at it, I increased Strong Wall from two
pieces to three pieces, and made Slow and Speed each give three attempts
(in an attempt to make these spells more useful).
* Added "bullet.gif" to archive.
* Modified the Spell Manager to also produce a HTML WWW page detailing
all the spells with an index at the top. This means I can now easily
browse the spells on my PC.
* Added new powerups for creatures making high numbers of kills (in the
form of specific bonus spells).
* Devastation spell now correctly awards points.
* Added casting contraints to computer spell selection for new spells.
* Moved the foes vanquished display onto the first info screen.
============= start of editor upgrade =========================
* Added ALT-o menu-like system to editor.
* Added editor support for artifacts.
* Stopped insertion of objects belonging to player 0 (other than artifacts)
* Better support for inserting wizards.
* Can toggle undead status using "u" key.
* Undead status shown with a red tick at top of cell.
* Fixed a ClearBoard/Vanquish/ALT-o edit clash.
============= end of editor upgrade ===========================
* Replaced the reqtools with a file requester of my own making.
It is pretty slack at the moment, but at least we can get rid
of reqtools now. This is good for three reasons: (i) less
effort for uses (don't need to install reqtools), (ii) smaller
overall memory requirement for game, (iii) no negotiation
needed with reqtools author for a commercial release.
* Tidied up prog.tex documentation, particularly near the top.
Added a small ancient history section.
* Allegedly reduced the likelihood of computer creatures shooting
wizards protected with invulnerability.
* I made a bootable disk but for some reason the topaz font was
different and had wider width than normal when I started this
game. As a consequence some of the set-up screen were not
quite right.
-JC reply: You forgot to have an 80 column system-configuration file in
your devs/ dir. If this is missing then the OS defaults to a 60 column
topaz.
* If the level now increases above 5, then new spells (and the
initial spell list in the case of computer wizards) will be
composed mainly of unique spells.
* Added FLAG_SINGLE to computer assistance flags and increased the
assistance array to work from BowID onwards. FLAG_SINGLE in now
set for spell which should NOT be cast with double or triple
active.
* Converted the Intelligence stat from 3 bits to 4 bits and modified
all spell files, info.tex, and cast.tex accordingly. If we made
.MR 4 bits most stats would then be the same, but the MR case would
be a lot harder to do than Intel was.
* Added FLAG_NOWIZARDCELL to the computer assistance flags, to
indicate spells not to be applied to cells containing a wizard
even if the wizard is mounted or meditating (e.g. Alter Reality).
* Creatures killing their favourite food now get a combat and
recovery rate boost.
ObtainSemaphore (James Conwell) April 1, 1998 Begin Version 2.3
* Made a small change to the makechaos file so that it would work ok.
Upon first compiling the game from a fresh dir using smake unarchive there
is no rein.h file present so therefore reincalc cannot compile therefore
when the makefile attempts to run reincalc it simply isn't there and
doesn't run it. The makefile then continues on its merry way. I assume
this means that critical information is not being compiled into the game
regarding reincarnation. As this is the domain of SAI I am leaving this
for him to fix. NOW FIXED
* I converted my new game musics which I did months ago into protracker
format so they could be played by Chaos but 2 of the musics wouldn't
convert correctly due to using more than 31 instruments. And another
converted ok but sounds a bit off (Maybe its just my imagination). In
any case I will have to now add OctaMed support to music.lib in order to
play all the new music. I anticipate this will add several K to the code
size. I guess I won't bother adding this until after the 1 meg version
is finalized.
* BUG: Computer wizards refused to cast Magic Bow if they had double or
triple in effect. Bows and swords are cumulative so it is desirable to
cast them with triple. NOW FIXED by removing CAST_SINGLE from bow.spl.
* EDITED spell descriptions: Gray Elf, Willy, Arctic Wolf, Gravity, Virtue
(btw: why is this spell called Virtue?), Paradigm Shift, Ball Lightning,
Emerald Dragon, Battle Cry, Coercion (shouldn't this be called mind blank
or something?), Materialize, Meddle.
* NOTICED: I noticed that some of the spell descriptions have been rewritten
to be more succinct. I like this.
* BUG: Now that you have shifted the info screen, the stat-highlighting is
off since it wasn't shifted to match. The hotspot was off too. NOW FIXED.
* BUG: Magic Glass doesn't say "Blocks LOS Enemy Only" on 2nd info screen.
FIXED.
* BUG: a dragon just shot my wizard through a magic glass. The "l" key shows
that the dragon does not have line of sight to my wizard yet he shot him
anyway. The shooting routine (at least for independents) must not be
taking into account Line of Sight rules 100%. The problem turned out to be
that the shooting code was checking for LOS like this:
if (!isLineOfSight(cell,c) continue; when it actually is supposed to be:
if (!isLineOfSight(c,cell) continue; FIXED.
BUG: I saved my game a little while ago with some Magic Glasses on the
board and now that I reloaded it I find that the reloaded game does not in
any way resemble the game that I saved.
BUGS: The filerequester sometimes never goes away. Sometimes it says it
loads a game but doesn't redraw the gameboard.
* CHANGED: Dagger -> Poison Dagger
* CHANGED: Basilisk ranged weapon to attack movement rating. (Basilisks are
supposed to paralyze with their gaze. 8)
* FLAW: Clicking on Ranged Combat on Info screen of Basilisk or Arctic Wolf
does not highlight "Movement" so that you can see that they attack
Movement instead of life. FIXED.
File requester doesn't even have a cancel button or any way of navigating
dirs. One time I quit the game and the requester screen was left up even
after the game had terminated. In fact, it is still up now, hours later.
FREAKINDICULAR!!!!! I just went back to look at it and uhhh... it has
become exactly like the main game screen!!!! It looks just like the game
board!!!! And it is animated too!!!! All the creatures are in the same
place!!!! WOW!!!! Holy cowabunga!
Now I quit the game and the ghost screen has gone blank again like it was
before I started! How is this possible??? The ghost screen is still up,
just completely black. weirdness...
The only way this is possible is that both screens were pointing to the
exact same area of memory. So each "screen" was simply a different window
onto the same area of memory. Mystery solved.
* Implemented req.library file requester into the game.
I've been planning to do this for ages but never had time before.
This has the following advantages:
1. Easy to use.
2. Features high-speed smooth scrolling.
3. Features powerful pattern-matching.
4. Features directory caching. (YAY!!!!)
5. I've been using it for years and it is perfectly reliable.
6. No negotiation needed to use it in our products.
7. Only 18436 bytes in size. That's 27,700 bytes smaller than
reqtools.library and 22,508 bytes smaller than asl.library.
STRUCTURE COLLISION! reqbase.h defines a "FileRequester" structure but so
does the new asl.h I am renaming the structure in reqbase.h to be
"FileRequesterStructure". Hopefully that will fix everything.
reqproto.h modified appropriately.
I copied the following files:
copy reqproto.h to include:proto/ clone
copy reqbase.h to include:libraries/ clone
copy req.library to libs: clone
copy lreqglue.o to lib: clone
The LoadGame function causes 3 enforcer hits while reading block W.
Well... now the problem seems to have mysterously vanished. ??
I fiddled around with the colors of the requester but never found any
that I really liked. I'll leave the selection of colors to whoever wants
to do it. I'd like the window border to be dark blue but I don't know
how to do that.
PROBLEM: After I've played Chaos for several hours and I'm really tired
I sometimes select load when I meant to select save. Sometimes I select
save when I meant to select load with disasterous results. Sometimes
this happens due to tiredness and sometimes due to a less than 100%
Right Mouse Button. So I made the load and save screens noticeably
different. PROBLEM SOLVED.
* PROBLEM, after selecting save then cancel the text at the bottom of the
screen is erased so you can't tell whose turn it is. FIXED.
* NEW FUNCTION VerticalWriteText
---------- Resumption of Efficiency Upgrade Speed/Memory -------
Chaos is currently
1288456 / 342808 bytes in size.
* Edited cmove.tex:
1259496 / 342640 Saved 168 bytes in GetWizardWeight
1259448 / 342568 Saved 72 bytes in EngageChoice
1259432 / 342500 Saved 68 bytes in cMoveEngaged
1259360 / 342364 Saved 136 bytes in cMoveNonEngaged
1259232 / 342212 Saved 152 bytes in MoveAutomaticallly
1259224 / 342180 Saved 32 bytes in cShootScore
1259236 / 342140 Saved 40 bytes in cShoot
TOTAL SAVED cmove.tex 668 bytes.
* BUG: Computer controlled archers refuse to shoot things that they don't
have Line-of-Sight to. In other words, computer creatures which have
archery ability are never actually _using_ their archery ability.
NOW FIXED.
* CHANGED: Bolter to have 0 Combat. (Since they can't attack anyway.)
* CHANGED: Magic Glass to not need line of sight when casting it. And it
can now be cast on corpses too.
Chaos is currently
1316936 / 342152 bytes in size.
* Edited move.tex:
1288092 / 342104 Saved 48 bytes in isEngaged
1287028 / 340904 Saved 1200 bytes in Combat
1287016 / 340848 Saved 56 bytes in MoveEverybody
1286920 / 340640 Saved 208 bytes in SpecialCombatHandler
1286812 / 340500 Saved 140 bytes in MoveTempest
1286580 / 340212 Saved 288 bytes in Growth
1286572 / 340180 Saved 32 bytes in SelectCreature
1286584 / 340168 Saved 12 bytes in SayCreatureName
1286532 / 340088 Saved 80 bytes in GetNewCell
1286184 / 339712 Saved 376 bytes in CrMove1
1286160 / 339596 Saved 116 bytes in DoShooting
1286164 / 339576 Saved 20 bytes in CrShoot
1286136 / 339524 Saved 52 bytes in Killed (Standard Editing)
1286096 / 339472 Saved 52 bytes in Killed (Replaced 7 occurences of van_count[loc] with *van_countp)
1286108 / 339380 Saved 92 bytes in CanGrow
TOTAL SAVED move.tex 2772 bytes
******** Memory Efficiency Upgrade COMPLETED (finally) ****************
* FLAW: After clicking on a flying creature the really cool mouse reporting
is turned off so you can't automatically know what your mouse pointer is
over. FIXED.
* FLAW: After clicking on a ground creature the really cool mouse reporting
is sometimes turned off so you can't automatically know what your mouse
pointer is over. FIXED.
* CHANGED: Inanimate objects are no longer highlighted in the color cycling
color when you press the number keys. Technically, it was correct to
highlight them with the color cycling color since their moved bit was not
set but since you cannot move inanimate objects or even click on them I
decided it was best to have them highlighted like other objects which can't
currently be moved (in red). Ditto for growths.
* CHANGED: Speed spell gives 2 attempts instead of 3.
***** BONUS SPELL SELECTION UPGRADE *****
* Upgraded Bonus spell selection so that you can see what you did to earn
the bonus spells.
* Edited bonus.tex
* Edited cast.tex
* Edited prog.tex
* Edited move.tex
* Edited all relevant spell files
* All appropriate code sequences now replaced with a call to the new
AwardBonusSpell function.
* Edited init.tex to initialize the new info properly.
* Edited io.tex to properly load and save the new info.
***** BONUS SPELL SELECTION UPGRADE COMPLETE *****
* BUG: Pyrotechnics wasn't awarding bonus spells based upon what it killed.
It was always awarding the number of bonus spells associated with killing
wizards rather than the creature actually killed. FIXED.
* BUG: Pyrotechnics wasn't awarding points based upon what it killed.
It was always awarding the number of points of a wizard's initial life
rather than the number of points of initial life of the creature killed.
FIXED.
* CHECKED Storm for the same bug as Pyrotechnics, but it checked out ok
with no bugs found.
* Fixed Team score sorting bug. The problem was that the scores were being
calculated based on team numbers but displayed based on player numbers.
It needed to be calculated and displayed based on one or the other.
NOW FIXED.
* BUG: Computer players are casting Magic Castles and Dark Citadels far
away from themselves. FIXED. (This was considered stupid so I just
modified isStupidCast to detect this.)
* CONFUSING: The display of the Team Icon on a Wizard's info screen
display. This is no longer needed due to the improved number keys + Team
Score display. REMOVED.
* q key now quits from info panels any other key continues on just like a
LMB (Left Mouse Button) press. Now using the q key RAWKS!
* BUG: At one point in the music, the lowest note of spectrogram 3 is
showing up as the highest note of spectrogram 2.
Made a simple 1 channel mod that plays notes from lowest to highest
and watched it on my scopes to see if it played correctly.
WOAH! All this time my spectrograms were significantly off!
Spectrogram 1 was ok but spectrogram 2 was off by 4 bytes and spectrogram 3
was off by 8 bytes and spectrogram 4 was off by 12 bytes!
So basically you just couldn't see the lowest notes in the display.
ALL FIXED NOW.
* REMOVED all support for Oktalyzer music since the Oktalyzer replay code
in music.lib was bugged and couldn't play my >64k samples and since I
only had 1 ChaosTheme song that was 8 channels anyway and since I am about
to finalize the "final" 1 meg version of the game.
Removed over 50k of assembler source code.
music.lib reduced in size from 34780 -> 24112 saved 10668 bytes.
This reduced the executable filesize by 14108 bytes.
I figure we can better use that 14k for other things right now.
* Implemented "Instrument Flashing" into Music.lib asm code. This allows
us to detect and do something anytime a particular instrument in the music
is played. Its primary purpose is to allow us to animate something to
the beat of the music. (The quadrascope and spectrograms work by channels
not by instruments.)
* Implemented monster dancing for song 1. I finally got "Instruemnt Flashing"
working for Monster Dancing but now I see that the OS DrawImage routine is
soooooo ridiculously slow that I can't even have *1* monster dancing on a
25 Mhz 030 without it screwing up and slowing down my jcquadragram. And
on the 7Mhz 000 it looks atrociously bad. 8( So I am leaving the code
intact just not "activating" it until someday when I have time to
integrate my new asm gfx routines which are a zillion or two times faster.
Oh well, at least I can see that the concept will look fairly kewl.
Or we could just convert a few Monster Images from DrawImage format into
Sprite format and then just animate the sprites. That would be vastly
faster and would work on any Amiga right now. Does anyone want to do
this?
* BUG: Selecting QUIT from setup screen I or II causes the game to crash.
FIXED by commenting out the code for the QUIT and LOAD gadgets. This was
the easiest and fastest way to fix this problem and it makes the program
simpler and easier to understand since now the ONLY way to quit or load the
game is from the dropdown menu in the main game.
I left all the gadget code intact in init.tex in case you
want to use it / fix it in the future. I'm just in a hurry to get the final
A500 1 meg, no HD version done at the moment.
* IMPROVED ChaosDocs.tex a bit.
******************* Editor Upgrade *****************
* FIXED warnings about no prototypes in editor.tex.
* FIXED the flaw where it still said you were in the editor after you had
quit the editor.
* PROBLEM: I can't tell what my mouse pointer is pointing at when using the
level editor because the really cool auto-mouse-reporting feature isn't
there 8(. I just LOVE always knowing exactly what I'm pointing at
because A) Some creatures look just alike and B) I don't remember what
every spell looks like. Indeed, this is the main reason I liked using my
mini-level editor; I always knew exactly what I was looking at because the
computer always automatically told me, no guesswork involved.
SOLUTION: I put in auto-mouse-reporting code into editor.tex. YAY!!!
* ShiftKeyIsBeingPressed is now a global variable.
* Enabled keypresses in Main Level Editor.
Made several routines:
KeypressNumeric(); // Show all creatures on your team.
KeypressL(); // Line of Sight
KeypressM(); // Move
KeypressR(); // Range of shooting weapon
KeypressS(); // Shoot (Things you can actually shoot)
* FIXED the top level of Alt-o menu system to print the name of the actual
category that you are pointing at. (I had always intended my alt-o mini
editor to do this but just never got around to it.)
* Enabled Keypresses even during the Alt-O menus. Now when you have a list
of undead creatures sitting in front of you and you want to pick one that
is tough but has a low recovery rate you just press q on each one and look,
_then_ you pick the exact one you really want with your mouse. Nifty.
* This also was a good excuse for me to clean up the HandleIDCMP code a bit.
* Now the official level editor is good enough that I can quit using my
mini-level editor! In fact, I seriously considered deleting my
mini-editor from the source code but I refrained from doing so because
once I start implementing a future gigantic, complicated upgrade there may
be a period of time during the transition where the official level editor
stops working. During such a time I can still use my editor to throw
monsters on the screen and test new gfx routines and stuff.
* New Predicates: isIDspecialcombat, isIDweirdattacker, isIDcastfree
* New classes of creatures such as "Flying Shooters"
"All creatures with weird attacks", "All creatures with special combat",
"CAST_FREE Scrolls" and "Spells that require a target".
* Completely rewrote Info.tex to use pointers to Cell Structures rather
than copies of Cell structures.
1. This allows the usage of our standard IsDead, IsUndead, IsCloaked and
IsScroll macros instead of all that char_stat.stat & XXXX_STAT code;
thus making the code a bit easier to read.
2. I had to do it so that the level editing code in info.tex could
actually change the values of stats.
3. Doing this + deleting dead code + making optimizations saved 1972
bytes on the smake dev code size.
* Implemented stat-editing on info panels when brought up from within the
level editor (LevelEditorActive==YES).
Use the mouse to click on the stat and then enter the new stat right on
the screen.
* MODIFIED COMBAT, RANGED COMBAT, SPECIAL COMBAT GADGETS TO HANDLE UP TO 4
CHARS. -15(NULL).
* BUG: Most recovery rate graphs are not being redrawn when clicking on
Combat, Ranged Combat or Special Combat to see what they attack. FIXED.
I couldn't figure out how to control the color of string gadgets... ???
It doesn't matter right now but it might in the future.
* Upgraded CheckHotSpot to handle any size of BoundingBox Structure.
(Bounding Box Structures are now terminated with {-1,-1,-1,-1}
* You can now edit attributes on the 2nd info panel. Just click on a
stat to toggle it.
* Tested making an attacking, flying, shooting, meditation, mountable set 1,
creature generator. Hehehehehee HARHARHAR ROFL!!!! It actually works!
I can fly my DragonNest around the screen attacking and shooting things!
And I can mount it and dismount it!!!! And it emits dragons for me even
while my wizard is mounted in it!!!! ROFDL!!!! The game engine gets an
A+ for allowing this to work on the first try!
* I inserted code for editing Move_Recover and Range_Recover stats
into info.c. Just uncomment 2 lines of code and it will work.
flashfind from "" search Move_Recover and uncomment all the other
lines of code in other modules and all will work fine whenever you
add Move_Recover and Range_Recover stats to the game. I would have
went ahead and added them myself but I wasn't sure how to do it anymore
with the new system.
Ok that's it for this upgrade. I'll leave the editing of names, scores,
and spell lists to SAI.
****************** End Editor Upgrade *****************
* FIXED those blocks for Range and Move on info panel. Scooted them down 2
pixels.
* MAJOR FLAW: sometimes the speech doesn't work, sometimes it does... it is
completely random. This affects monster names, creature names, player
names, everything...
Put breakpoints on SayCreatureName, SayName and Say and then play a test
game and figure out what the hell is happening... I just couldn't find any
pattern to the failure of the speech. At first I thought maybe it was an
unmatched say/waitforsay pair but after checking through the game for an
hour that just wasn't it. So then I thought maybe some other sound effect
was somehow not releasing the audio.device (like maybe the combat sound
effect) But no that just wasn't it either. Ok, well I finally found the
problem in the Say() function:
voice_io.pitch = 65 + MSGRandom() & 0xFF;
Sometimes this sets voice_io.pitch to a very low number like 21 or 28 etc.
Values this low produce no sound in the speech system.
Changing the offending line to:
voice_io.pitch = (UWORD)(65 + (UWORD)MSGRandom() & 0x00FF);
still doesn't work... Must be changed to:
voice_io.pitch = (UWORD)65 + ((UWORD)MSGRandom() & (UWORD)0x00FF);
NOW COMPLETELY FIXED.
* Nowhere did it say what type of value MSGRandom returns, not even in its
prototype. NOW FIXED (int)
SAI: In C if a prototype does not designate a return type it is assumed to
an int. However, it is generally better to define it anyway.
??? Creatures with 0 move and 0 manuverability sometimes are not
engaged to adjacent enemy creatures. How is that happening? It used to be
that 0 manuverability meant you were automatically engaged to any adjacent
enemy creature. Did you change this on purpose? This is fixed months
later.
* FIXED: Pressing Amiga-m or Amiga-n on info screens was clearing the info
screen because ANY key triggered going to the next info screen. NOW FIXED by
simply ignoring all keys except for q=quit and w,a,tab and return take you
to the next info panel.
* Speeded up line of sight testing by about 30% in many cases. YAY!
Well, I haven't added any new asm code in over 2 weeks so its about time
for:
* Speeded up SqDistance by 5% (eliminated 8 cycles) asm SqDistance is now
over 12x as fast as C SqDistance. YAHOO!
* Speeded up SqDistance again. (Eliminated 4 cycles on 68000. 68030 cycle
count unchanged.
********* HIGH-SPEED Vector Graphics Upgrade ****************
********* PART I ****************
* Implemented hyper fast sin and cos asm functions. (JCSin and JCCos)
James Conwell's FAST Trigonometric Functions.
=============================================
I could never decide what to call these next 2 functions.
I could just call them FastSin and FastCos but that would infer that
they do the same thing as sin and cos which they DON'T.
These functions have less significant digits than the "real" sin and cos.
These functions are MUCH faster than the "real" sin and cos.
These functions require the input angle to be measured in units of jams,
NOT degrees or radians. 1 jam = 1/4096th of a complete circle.
512 jams = 45 degrees.
1024 jams = 90 degrees.
2048 jams = 180 degrees.
3072 jams = 270 degrees.
4096 jams = 0 jams = 360 degrees = 0 degrees.
btw jams stands for "James' Angular Measurement System". This system
fully utilizes the power of binary integer arithmetic inherent in all
CPUs.
Since the ABSOLUTELY SMALLEST angle that could ever be graphed on a
standard Amiga display is 1/640th of a circle, dividing a circle into
4096 equal parts should be far more resolution than needed.
Furthermore, it would require the use of the entire width of the screen
to graph an angle of 1/640th of a circle, so it is unlikely that we would
ever need 1/640th of a circle resolution.
These functions derive their speed by:
1: Using fast lookup tables.
2. Using integer multiplication instead of Floating point Multiplication.
3. Using perfectly optimized assembly language code.
Only 7 instructions for the whole routine! (And 1 of those is RTS)
Note that I overlapped the sin and cos tables so that instead of having 2
seperate 8k tables I have only one 10k table.
The table size could have been greatly reduced by defining a jam to be
only 1/2048th or 1 /1024th of a circle. But I wanted lots of accuracy to
be safe. (Some games and demos allegedly get away with a 256 angles per
circle system)
TIMINGS for Result = Multiplier * Sin(angle)
1 frame = 1/50th second.
Processor Clock Rate Method Speed
68000 7.15905 Mhz scm.lib (IEEE double) 206 calls/second
4.1 calls/frame
68000 7.15909 Mhz mathieeedoubtrans.library 222 calls/second
(IEEE double) 4.4 calls/frame
68000 7.15909 Mhz mathtrans.library 1282 calls/second
(Motorola Fast Floating Point) 25.6 calls/frame
68000 7.15909 Mhz JCSin asm code 58000 calls/second
(16 bit precision) 1160 calls/frame
68030 +
68882 FPU 25 Mhz mathieeedoubtrans.library 13000 calls/second
(IEEE double) 260 calls/frame
68030 25 Mhz scm.lib (IEEE double) 1190 calls/second
23.8 calls/frame
68030 25 Mhz JCSin asm code 232558 calls/second
(16 bit precision) 4651 calls/frame
Time to JUST multiply a double * a double using scm.lib:
68030 25 Mhz scm.lib 24509 calls/second
490 calls/frame
84 seconds to do 100000 multiplier * sin(angle) with scm.lib
4 seconds to do 1000000 JCSin.
43 seoonds to do 10 million JCsin
408 seconds to do 10 million scm.lib double * double
So as you can see, even if we are doing simple rotation where we can
precalculate value*sin(angle) and then just do double * double in the main
loop JCSin is 9.49x as fast!
JCSin can calculate the sin of a number and multiply it by a value 9.49x
as fast as SASC can _just_ multiply two IEEE double numbers together
_without_ any sin calculation!
At the time of this writing, Chaos (world's best strategy game) is
drawing vector graphics to the screen using the "Precalc IEEE double
method" whereby the main loop doesn't need to do any slow sin/cos
calcualations. Nevertheless, rewriting that section of code to use JCSin
will increase the speed of the math computations by a factor of 9.49!
I put off implementing these routines for a long time because at first
Chaos had no vector graphics so I decided to delay until I was ready to
implement some vector graphics. But then one day SAI implemented a
roatating vector pentagram and I knew then that I would have to move up the
day when I implemented these routines. That day has come.
If we are going to have vector graphics in Chaos then dammit! We are
going to have vector graphics just as good as everyone else!
I want Chaos Vectors to be just as good as Star Wars, Empire Strikes
Back, BattleZone, Tempest, etc. JCSin and JCCos are a solid first step in
that direction. BTW: I _LOVE_ vector graphics! I've wanted to program
animated vector graphics ever since I first saw an ad for an Apple ][
circa 1981 that had some sort of graph plotted on the screen.
(Of course this blue graph couldn't move at all, but I didn't know that
from looking at the advertisement.)
LIMITS:
sin and cos values have 15 bits of resolution + 1 sign bit.
Multiplier inputs are limited to -16383 to +16383. This should be WAY
WAY WAY more than we really need.
Final answer contains 15 bits of resolution + 1 sign bit.
This should be WAY more than we need for drawing vector graphics and just
the right amount for generating 16-bit sound samples.
UNITY=32767
Smallest angle = 1 jam = 1/4096th of a circle = about .088 degrees
It is totally safe to call these functions with large angles. It
automatically takes care of "wrap-around" angles. So if you need to add
angles up to more than 4096 jams then go right ahead. It can wrap around
several times and still work perfectly. Beyond that is untested.
CONVERSIONS:
AngleInDegrees = 360 * AngleInJams/4096
AngleInRadians = 2 * PI * AngleInJams/4096
AngleInJams = 4096 * AngleInDegrees/360
AngleInJams = 4096 * AngleInRadians/2*PI
HOW DOES THIS WORK?
Well, since it seems that sin and cos are always used in conjuction with
multiplying by some number and since floating point multiplication is
inherently VERY slow I decided to make a system that could use integer
WORDS to do the same thing, only faster.
You give these functions a multiplier and an angle measured in jams and
you get a result of the sin of the angle multiplied by the multiplier.
This should allow us to do high-speed vectors with scaling and rotation
of any angle and speed we desire.
**************** PENTAGRAM VECTOR UPGRADE **************
All timing tests performed on A3000/030 @25Mhz with all CPU caches on and
burst mode activated. Of course I removed the WaitVblank code for this
timing test so I could find the absolute speed of the code.
Original MenuAboutUpdate 10,000 times
Entire thing = 90 seconds = 112 calls/sec = 2.2 calls/frame.
This means that each call takes about .44 of a frame to execute so that if
the pentagrams were being drawn in the bottom 1/2 of the screen then it
should theoretically be fast enough to run at 50 fps on 030 with no flicker
without being optimized.
In any case the current speed is nowhere near fast enough for the A500.
Just the mathematics = 10 seconds = 1000 calls/sec = 20 calls/frame
Just the graphics = 80 seconds = 125 calls/sec = 2.5 calls/frame
Upgrade Part 1: Changed WriteMask to 0x08
Just the graphics = 20 seconds ( 4x speed increase)
Upgrade Part 2: Copy the first pentagram with ClipBlit() instead of drawing a whole new one.
Just the graphics = 18 seconds (Very disapointing speed increase 8(
Upgrade Part 3: Rewrote Mathematics to use JCSin and JCCos
Just the mathematics = 1 seconds (10x speed increase)
Just the graphics = 18 seconds
Whole Routine = 18 seconds
Upgrade Part 4: Disabled ClipRect
LoResRastPortClipRect=rastPort->Layer->ClipRect;
rastPort->Layer->ClipRect=0;
DID NOT WORK. 8(
LoResRastPortLayer=rastPort->Layer;
rastPort->Layer=0;
WORKED!
Whole Routine = 16 seconds (11 % speed increase)
Upgrade Part 5: OwnBlitter() DisownBlitter() FAILED.
Attempting to surround all the Draw() commands with
OwnBlitter()/DisownBlitter() resulted in a machine lockup.
OwnBlitter()/DisownBlitter() do NOT nest. Any task attempting 2
OwnBlitter() with no intervening DisownBlitter() will lock up.
(I learned this the hard way but it is documented in the RKM)
Upgrade Part 6: DoubleBuffering. AVERTED for now.
Since the pentagram drawing routine now takes less than .04 of 1 frame
to execute this means that if we draw the pentagrams further than .04
of a frame down the screen (10.24 pixels) then we don't need to
double-buffer it (Referring to time on 25Mhz 030). Since the pentagrams
are currently about 24 pixels down the screen we should be safe, even on
the A500. But be warned that in a period of high-cpu load multitasking
the pentagrams might start to flicker due to not being double-buffered.
I was having a problem that I had anticipated: The pentagram was
"degrading" after multiplle rotations due to cumulative round-off error.
So I fixed it by simply having all rotations based upon the ORIGINAL
cooridinates of the pentagram. Instead of rotating 23 jams each time, I
have it rotate 23 jams the first time, then 46, then 69 etc. However,
this brought up a new problem:
Trying to rotate the object more than 512 jams (45 degrees) at one time
causes the pentagram to begin shrinking and expanding randomly. ????
This problem is being caused by the fact that JCCos is returning wrong (and
strange) values beyond 45 degrees / 512 jams. I can't for the life of me
see what could be wrong. AFAICT this is caused by a bug in Devpac when
assembling large tables. CodeProbe just freaks out and starts lying to me
about the contents of registers whenever I try to trace through the code.
* Made numerous changes to AnimatorAsm.s so that the SASC "asm" command
could assemble it... All was going well but there is a bug in SASC 6.5
"asm" that prevents it from using binary numbers in the data sections
(Which is very strange since binary numbers work fine in the code sections).
I am very tired now and have other things I must
work on. In the meantime I have used the symmetry of the pentagram to work
around this problem with a little trick. When the rotation reaches 512
jams I reset it back to 0 jams and all works fine.
* Ok I have now proven for a fact that Devpac is NOT assembling AnimatorAsm
correctly. It is not including about 4k of my sin/cos table for
some strange reason. As soon as I upgrade to a new version or switch to a
different assembler all will be working fine.
* Tried inserting numerous fake labels into the asm data so that there would
be <1000 bytes of data between labels but this had no effect. My table is
STILL not being included in its entirety. 8(
* Switched the asm source over to use the A68K assembler (This is the
assembler that I have been using on music.lib) version 2.71 1991. It has
the EXACT same bug that Devpac 3.14 1994 has! This is very strange. I
even increased its hash size to 9999 and its heap to 30,000 but this had
no effect.
* Attempting to switch over to ASM-ONE v1.16 1993. I used to use v1.08B
1991 of this assembler a lot years ago because it has the best user
interface. Unfortunately it had certain bugs so I eventually stopped.
Trying now: It can't handle the @ sign in fuction names. It can't handle
spaces in dc.w statements. It can't handle local labels (at least not
with \) Giving up on this. 8(
* BREAKTHROUGH! Using A68K assembler I have just found that if I remove
the 14 blank spaces in my dc.w lines that it then includes an extra 16
bytes of my table data! This means that it _should_ include the whole
table if I just eliminate all the blank spaces!
Unfortunately it didn't work out quite like that. It included MOST of the
data but not all. 8(
VERIFIED that Devpac behaves the EXACT same way.
After removing the spaces the filesize from devpac went from 17568 to
23088. (It included more of the table data (5520 bytes))
* FINAL REPORT on Devpac Bug: As far as I can tell, it was only including
the FIRST data item on each line. I had 8 data items on each line so only
1/8th of the table was really being included. Thus when I rotated the
pentagram 45 degrees I was _really_ rotating it 360 degrees which would
explain why it looked so smooth when I reset to 0. This is all AFAIK.
* Reassembled the code using 1 number per line in the DC.W and now JCSin
and JCCos are working perfectly!!!!!! YAHOO!
* Added some extremely simple 3D rotation to the pentagram.
***** END PENTAGRAM UPGRADE ****
******** END HIGH-SPEED Vector Graphics Upgrade *************
******** END PART I *************
* Edited asm Getxy to save 2 cycles on 68000. 68030 cycle count unchanged.
* Edited asm AnimatorAsm to save 6 cycles.
* Disabled clipping on quadrascopes + quadspectrogram for small speed gain.
* Time to execute 100,000 DrawImage(FaunID) on 25Mhz 030 + 7Mhz Blitter
with clipping enabled 63 seconds
with clipping disabled 57 seconds (9.5% faster)
Time to execute 100,000 DrawImage(DarkPowerID) (Chosen because it has lots of color)
with clipping enabled 72 seconds (27.7 calls per frame)
with clipping disabled 66 seconds (8% faster) 25Mhz 030 + 7Mhz Blitter
Time to execute 100,000 DrawImage(DarkPowerID) to an unaligned memory location.
with clipping disabled 70 seconds (6% slower) !!! This means DrawImage
is terribly inefficient. If it was efficient then an unaligned drawing
would take 50% longer or more.
Time to execute 100,000 "Highlight a cell" on 25Mhz 030 + 7Mhz Blitter
with clipping enabled 118 seconds
with clipping disabled 97 seconds (19.5% faster)
Remember these speed improvements will be much greater on a 68000 because
it does math much more slowly and because the blitter is the same speed
on both systems.
* Disabled clipping during the AnimatorTask for about an 8% speed boost on
030 (should be at least a 24% speed boost on 68000) The A500 version
needs as much speed as possible. A mysterious blue line has now appeared
on the left hand side of the board to mark the edge. ??? I think my
Amiga has become sentient and is trying to help me design the game on its
own initiative. 8)
* OOPS! With no clipping, when you are using the drop down menus the
animated monsters overwrite them. Ok, I have sort of fixed this by using
the MENUVERIFY feature of the OS. Unfortunately there are so many
different places that handle IDCMP messages now that it is causing a
problem. I have only fixed the main HandleIDCMP routine for now.
SAI: This fix is what is causing problems to menus. See later.
* Ok, I have now modified all those keypresses that highlight cells to
temporarily disable the menus. EVERYTHING IS WORKING PERFECTLY NOW.
* REMEMBER THIS: The animator Task has proven itself to be safe therefore
it is disabling the OS clipping to get a speed boost. Therefore; we are
now using MENUVERIFY so that before any menus are drawn we can stop the
animator from running (to keep it from drawing over the menus). This
means any time you are going to parse messages from the IDCMP from "window"
You MUST be prepared to deal with this by either correctly handling
MENUVERIFY (see HandleIDCMP for an example) or just disable the menus or
just turn off the MENUVERIFY feature via ModifyIDCMP();
I know this is something of a hassle but this programming technique was
going to be neccessary eventually anyway for the day when I put in my
asm gfx routines which simply don't know anything about clipping or menus
or such things.
* REMEMBER THIS: Do not ever disable the OS clipping for any routine unless
you are ABSOLUTELY sure that it NEVER will EVER write outside the bounds of
the rastport.
* About, New, Quit etc. (things in menu.tex) should get a lock on the board
first to keep the animatortask from overwriting the display. FIXED.
* Changed xpixel[] and ypixel[] arrays to be arrays of UWORDS instead of
ints. UWORDS are faster and take only half the memory of ints. Adjusted
C + asm code accordingly.
* Disabled clipping in DoTheHighlighting() and Highlight() to get the 19.5%
speed boost.
* BUG: smake release version freaked out on alt-o in official level editor
due to backupboard not being allocated. FIXED.
* New option: smake demo. Allows us to manufacture a demo version of the
the game with no loading, saving or level editing.
* #IFDEF all loading and saving code.
#IFDEF'ed all calls to LoadInit, SaveGame, LoadGame and LoadLevel.
* #IFDEF'ed all level editor code.
* #IFDEF'ed all the file requester code in menu.tex.
* #IFDEF DEMO a check for turn 20 and quit the game.
* Removed io.o and editor.o from smake demo linking
* Attempting to edit, load or save produces the message "Removed from DEMO
version. Please register."
* CHANGED: The level editor is no longer mentioned anywhere in the docs or
the game due to the fact that it isn't completed yet, etc.
* Solved the mystery of accessing NEAR C variables from asm.
* Rewrote DoTheHighlighting in asm for a 9.28x speed increase. I want the
game to respond instantly to the player's commands.
* Old C DoTheHighlighting could only highlight 20.6 cells per frame (and
this speed includes the "turn off the clipping" trick.)
New Asm DoTheHighlighting always highlights 191.1 cells per frame.
9.28x faster! This should be a full 10x faster on most Amiga systems
because most Amigas have their graphics.library in the kickstart ROM but
my A3000 loads kickstart into FastRAM. ROM chips are very slow compared to
ram chips. Plus my fastram is compatible with Burst Mode CPU accesses
which I don't think any ROM chips support.
* Rewrote KeypressR() to use DoTheHighlighting(); so it can take advantage
of the enhanced speed like the other keypresses.
* Implemented Lissajous Squares Quit Menu thingy. I did this for the
following reasons:
1. I wanted to do a really kewl requester.
2. I am vaguely planning to play a different piece of music on each
requester in menu.tex; therefore, I need all the requesters to be
silent so as not to interfere with the music.
3. Amiga color-cycling RULEZ!
FEATURES:
1. Looks kewl.
2. 31 colors are cycled.
3. Just when you think it is going to shoot off the screen it arcs around
and comes back.
4. Fast.
5. Smooth.
6. Infinite variety. (Only the first one is the same each time, after
that they are randomly generated. Zillions of different designs.)
8. Utilizes Asm TestPixel, JCSin and JCCos.
* We can now turn on/off the color cycling of the lores screen with the
variable LoResColorCycling. e.g. LoResColorCycling=OFF; turns it off.
* Minor touchups on Setup Screen I
* Edited description of Reflector.
* Replaced "New Game" requester with Lissajous Squares version.
* Monday June 1, 1998 19:01:42 attempting a "smake demo" with stripdebug and
optimize. Finished 19:29:13 WOW! It took less than 30 mins on my 25Mhz
030! The optimizer reduced the max codesize from 305192 to 293044.
But the final filesize is 328608. Hmmm.... I guess that means we have
35K of graphics in the source code?
* Changed default spell list to 99. Thus anyone playing the demo version
will definitely see lots of spells that they never get a chance to cast.
hehehehe.
* Other miscellaneous bugfixes.
* Edited docs to include info about the demo version.
* BUGS: The Bonus Spell Window and the "Demo Over Window" are being
overwritten by the animator task. FIXED.
* Reduced the length of a demo game to 18 turns because I played a test
game and I won in about 15 turns due to Classic mode giving me lots of
tough creatures to squash the independents with. (I was controlling 2
wizards against 4 generators.)
I seriously considered reducing it to 16 turns but I just can't decide...
How long should it be? What is your opinion? 10 turns? 18? 15???
SAI: The demo needs to be long enough that people will get hooked onto
some of the more strategic aspects of the game. Therefore, I think
that it is ok to be able to win in demo mode. Maybe 15 turns would be
good.
* BUG: The demo version of the game crashes when you try to exit the
"Demo Over Window". Calling TerminateChaos is the problem. FIXED by
making a new function QuitChaos() that can quit the game without crashing.
Tuesday, June 2nd, 1998. I have made a smake demo of the game and played
it a few times on my A3000. Everything works fine. But when I put it on
an autobooting disk and try to play it on my A2000 w/68000 and OS 1.3 it
always crashes with a guru #00000000004 Illegal Instruction.
I thought this might be caused by the SASC optimizer bug but I have now
recompiled without the optimize parameter and it still does the same thing.
I can't find the autobooting version that I made back at christmas time. 8(
Do you still have it? Maybe I am doing something different on this disk
that is causing things not to work. I just don't know. The problem should
be one of the following:
1. SASC bug that is generating an 020+ instruction somewhere. (possible)
2. Devpac bug that is generating an 020+ instruction somewhere. (doubtful)
3. A68K asm bug that is generating an 020+ instruction somewhere. (possible)
4. Not really an illegal instruction but merely a wrong file on the
autobooting disk.
5. Not really an illegal instruction but merely a missing file on the
autobooting disk.
I am testing on an A2000 with 1 meg chip + 8 megs fast so I don't think
memory is the problem.
* OK I found the problem. I didn't have the "run" command on the
autobooting disk. Execute(); requires run to be in the c: dir.
Well luckily I only wasted an hour trying to figure that out.
Ok, now the intro isn't running... the fonts aren't loading...
3 hours later ... after much trial and error I have it all working, geez
I am going to hafta document this autobooting disk format for future
reference. Every time I make an autobooting disk I have these problems...
* Ok the game is now working on the 7Mhz 68000 but for some reason when you
select a team all the checkmarks on setup screen I are redrawn. This
totally stops the quadrascopes for a second...
* Observations about playing the game on 7Mhz 68000:
1. l key for line-of-sight is still too slow. It can take up to 3
seconds. The days of the 7Mhz 1978 68000 are at an end.
2. The r for range and m for move are nice and fast.
3. The s for shoot was somewhat adequate.
4. The quadrascopes move slower than what I am accustomed to. Its a
damn good thing I removed the OS clipping from them.
5. The Color cycling on the "new game" and "quit game" requesters is much
slower but this actually makes it look better IMHO.
6. The left pentagram blinks noticeably. So much for getting away with
no double buffering. The right pentagram is nice and solid.
* ChipRam availabilty for Chaos v2.3d on a 512k chipram system:
During the Intro: 55008 bytes free! yeah! We made it!!!!
During Setup Screen I: 63848 bytes free!
During main game: 256200 bytes free!
During Information panel: 242200 bytes free!
During Quit Requester: 205400 bytes free!
We are currently using 380k of fastram. (So v2.3f should be about 440k)
These numbers mean that as soon as I start work on the sound and music
upgrade the game will require 1 meg of chipram or more + 1 meg of fastram
or more.
* I have now tested this OS 1.2 Autoboot Disk on an OS 3.0 stock A1200 in
both ECS and AGA modes and it doesn't work due to incompatibilities with
the OS versions of various libraries and cli commands. We will have to
make a separate autoboot disk for at lest the 2 major versions of the OS.
******************** AUTOBOOTING DISK FORMAT ******************************
===========================================================================
* Documentation for making an Autobooting floppy disk version of the game:
The disk must contain the following files in the following directories.
They are ALL REQUIRED.
I'm not on the internet right now or I would download one of those nifty
dirtree utils. Oh well, I'll just include a complete directory listing.
The docs may be placed in the root directory along with an icon and the
"more" command if there is room for it all.
Directory "df2:" on Sunday 07-Jun-98
libs Dir ----rwed Tuesday 09:58:44
s Dir ----rwed Tuesday 11:02:11
c Dir ----rwed Tuesday 10:54:40
devs Dir ----rwed Tuesday 05:22:12
l Dir ----rwed Tuesday 05:23:30
Chaos Dir ----rwed Wednesday 02:18:06
Chaos.info drawer icon for dragging onto harddrive.
6 directories - 12 blocks used
Directory "df2:libs" on Sunday 07-Jun-98
diskfont.library 4964 13-Aug-88 For access to fonts.
translator.library 10592 13-Aug-88 For the computer voice.
req.library 18436 07-Jul-93 For the awesome filerequester.
2 files - 71 blocks used
Directory "df2:s" on Sunday 07-Jun-98
Startup-Sequence 158 -s--rwed Tuesday 11:02:11
1 file - 2 blocks used
Directory "df2:c" on Sunday 07-Jun-98
run 2568 30-May-78 for Execute();
assign 3008 30-May-78 to assign the Chaos_Game: path
FastMemFirst 976 --p-rwed 30-May-78 16:28:46
SetPatch 3844 30-May-78 for OS patches
Add36k 648 13-May-92 To save 36k of chipram.
cd 1756 30-May-78 To assign the Chaos_Game: path
avail 1964 --p-rwed 30-May-78 16:27:15
list 9972 --p-rwed 30-May-78 16:28:02
more 16912 ----rwed 13-Mar-78 10:34:23
9 files - 95 blocks used
list, avail and more are not required at this time. I just like to use
those commands a lot so I always put them on my disks. FastMemFirst isn't
strictly required either; I just figured it was a good idea.
Directory "df2:devs" on Sunday 07-Jun-98
System-Configuration 232 13-Aug-88 For default 80-column display
ramdrive.device 2128 13-Aug-88 for the RAM: drive
narrator.device 23280 13-Aug-88 For the computer voice.
3 files - 55 blocks used
Directory "df2:l" on Sunday 07-Jun-98
Ram-Handler 6464 13-Aug-88 for the RAM: drive
Speak-Handler 4216 13-Aug-88 for the computer voice
2 files - 24 blocks used
Directory "df2:Chaos" on Sunday 07-Jun-98
fonts Dir ----rwed Tuesday 10:17:13
Music Dir ----rwed Tuesday 10:26:42
Chaos 328764 ----rwed Wednesday 02:15:39
chaos.prb 6729 ----rw-d 14-Apr-98 20:37:19
classic.prb 6471 ----rw-d 14-Apr-98 20:37:20
pool.ssc 42319 ----rwed Monday 19:12:31
Start_Chaos 311 ----rwed 31-Mar-98 05:49:42
Start_Chaos.info 2566 ----rwed 31-Mar-98 05:49:43
chaos.dat 66368 ----rwed Monday 19:15:43
7 files - 2 directories - 901 blocks used
Directory "df2:Chaos/fonts" on Sunday 07-Jun-98
chaos.font 264 ----rwed 01-Apr-98 22:23:30
chaos Dir ----rwed 01-Apr-98 22:23:29
Union.font 524 ----rwed 31-Mar-98 05:51:22
Union Dir ----rwed 31-Mar-98 05:51:22
2 files - 2 directories - 9 blocks used
Directory "df2:Chaos/fonts/chaos" on Sunday 07-Jun-98
8 1724 ----rwed 01-Apr-98 22:23:29
1 file - 5 blocks used
Directory "df2:Chaos/fonts/Union" on Sunday 07-Jun-98
34 5972 ----rwed 31-Mar-98 05:51:22
70 21948 ----rwed 31-Mar-98 05:51:22
2 files - 57 blocks used
Both sizes of the Union Font are used in the game.
Directory "df2:Chaos/Music" on Sunday 07-Jun-98
Mod.ChaosTheme1 192226 ----rwed 01-Apr-98 22:38:40
1 file - 377 blocks used
TOTAL: 31 files - 10 directories - 1608 blocks used
The startup-sequence should look something like this:
c/add36k
c/SetPatch >NIL: ;patch system functions
c/FastMemFirst ; move C00000 memory to last in list
c/assign t: ram:
c/assign c: c/
c:cd chaos/
c:run chaos
******************** END AUTOBOOTING DISK FORMAT **************************
===========================================================================
I just played a test game of the demo version on my A2000 and at one point
a computer wizard was killed by a fire and the WizardExplode effect started
then the game crashed with a guru #000004.
I played another test game on my A2000 and this time the game crashed when
a bolter wall shot my wizard and killed me. The WizardExplode effect
started and then the game crashed.
This is quite strange because I've played several test games on my A3000
and I have killed lots of computer wizards with no crashes. I have even
killed several wizards on the A2000 and not had any crashes.
This bug is probably being caused by either
A: clipping is somehow turned off during the wizardexplode effect and when
the effect goes off the edge of the screen it crashes the game. But if
this were true then it should crashe EVERY time a wizard dies, not just
some of the time.
B: It is a bug that affects all wizards killed by fire or any human wizard
that dies in any way.
Never mind the above paragraphs; all is fixed now. Read next paragraph.
* BUG: game sometimes crashes when WizardExplode effect reaches edge of
screen. FIXED by getting a lock on the board while doing the effect.
This ensures that clipping is turned on.
* As a general rule, graphical effects should get a lock on the board just
to prevent graphics mish-mash. And they should get a lock on the board
in case the effect writes past the edges of the screen. If an effect
doesn't get a lock then clipping might at that moment be on or off.
Getting a lock ensures that clipping is in it's default state (ON).
* BUG: sometimes computer players get to move twice. Independents never seem
to be able to move twice though. This bug never seems to happen until
after some wizards have died. NOW FIXED.
* BUG: The speech always seems to work during casting phase but it seems to
only work randomly during movement phase. Hacking more changes to Say()
in an attempt to make this problem go away.
* OK I think I found the speech bug: an intervening use of text_store
between say() and waitforsay(). Tested and the speech is working 100%
now.
* Made various changes to print what is being said first, then actually
saying it. Thus you can read what it is saying for the 2 or 3 seconds
that it is saying it.
* CHANGED Aerial Servant and Combat to be CLASSIC.
* BUG: Spriggan speech doesn't work. Allegedly FIXED by removing the "2"
from the end of the speech.
* Speeded up TestPixel. Saved 4 cycles on 68000 or 2 cycles on 68030.
* TestPixel is now known as TestPixel4. It tests the first 4 bitplanes of
any rastport.
* Made new TestPixel1 Routine which only tests the first bitplane of a
rastport. I needed this routine for various purposes.
* Put in some checksums for lamer protection.
* BUG: Any errors in the early startup phase (e.g. it can't open a certain
file) result in a crash. NOW FIXED.
Now that I know we have enough chipram laying around...
* CHANGED: the default font for the game to be pearl.font (now included
in the fonts/ dir.) I did this for 3 main reasons:
1. Games which use the standard topaz font always seem "cheap" compared
to games which use their own custom font. It just somehow feels more
"commercial" when you play a game with a font different than the one
you are used to looking at all the time.
2. The lowercase i of Topaz sucks.
3. I have tested many, many fonts to find the one which is the easiest to
read. And pearl is it. I have had pearl.font as the default font on
my Amiga for several years now. It just makes everything easier to
read. _Especially_ 640x512 resolution text which is the resolution
that I run everything in. I realize that Chaos does not currently use
that high a resolution but I just tested several fonts a few mins ago
against pearl in 640x256 mode and I could still see the difference.
* SMOOTHED out the outlining of the Large font during the intro. The
outlining used to appear blocky on certain letters. Now the jagged edges
are rounded off. This has the drawback of almost doubling the execution
speed of FancyWriteText but the slowness will really only be noticeable on
the 7 Mhz 68000 and for UAE lamers. Oh well.... too bad for them...
* STUPID: Computer wizards cast Ball Lightning on a Generator which
already had 0 combat. NOW FIXED.
* STUPID: Computer wizards cast Demonic Touch on other wizards who only
had 1 combat point. NOW FIXED.
* ADDED: Stupidity checking for Shocker.
* IMPROVED: Stupidity checking for Archery.
* BUG: The "Wings" mouse Pointer and the "X" mouse pointer became
corrupted at one point. This was possibly caused by a wizard dying in the
upper left corner or by another wizard dying by being covered with a
growth. I _think_ I fixed this but I don't really know.
* BUG: FLAG_NOWIZARDCELL is broken. Wizards routinely cast spells like
Subversion and Betrayal, etc. on creatures which have mounted wizards.
NOW FIXED.
* BUG: That silly clipping bug has reappeared again! I don't get it. Now
the WizardExplode effect is not working again. Argh. It is drawing
Wizards all throughout chipram... they circle around over and over again
at an angle on the LoRes Screen and they bleed over into the HiRes screen
and they even pour out into the workbench screen and the CPR screen!
I have verified that
rastPortLayer and rastPort->Layer are somehow both set to 0 before this
function is called. ???? .... 3 hours later... Ok, I figured it all out.
I had made a change at the beginning of start.tex to derive the variable
"rastPort" from the lores screen. But doing that gives a pointer to a
rastPort with no cliprect and no layer information. We must derive the
global variable "rastPort" from the backdrop window (which is how you had
it set up all along until I changed it in ignorance of this behavior).
ALL FIXED NOW!
* The above fix has apparently made that mysterious blue 1-pixel line on
the left edge of the screen go away.
SAI: This line periodically appeared for me during my test games, but
I was unable to determine the exact circumstances.
JC: I think it is something do with layers.library and enabling/disabling
OS Clipping.
* STUPID: My allied wizard just cast a pool far away from himself and right
up next to his enemy's base camp. FIXED.
* STUPID: Wizards sometimes cast Magic Wood trees directly adjacent to
enemy wizards. FIXED.
* NEW FUNCTIONS: IsAdjacentEnemyWizard(Cell *), IsAdjacentTeamWizard(Cell *)
* LESS THAN INTELLIGENT: Computer wizards only cast castles directly
adjacent to themselves, they never cast castles across the screen to be
adjacent to one of their allies. NOW FIXED and totally cool.
* MAJOR BUG: I just moved my Aerial Servant onto a Mass Resurrect Scroll.
Then somebody justiced my servant and killed it and I guess it "reinstated"
the scroll. Anyway there is now a weird creature whose 3 frames of
animation are Lion, Dead Lion, Mass Resurrect Scroll. It's stats are
totally freaked out with numbers like 78 and -78. It eats Hydras, it's
Mountable Set 1 and it's a flying meditation growth that can attack both
living and undead creatures. Weird stuff. The mouse thinks it is a Mass
Resurrect scroll that belongs to me, therefore its movement bit doesn't get
cleared so I can't click on it and move it. darn. I didn't have time to
try to mount it. I wonder what would have happened? NOW FIXED.
* FLAW: I tried to cast my python on a Ghost scroll and it said "Cannot cast
on Creatures" rather than the more appropriate "Cannot cast on Scrolls"
FIXED.
* BUG: A Faun Scroll just put my Ghoul to sleep! FIXED.
* BUG: Dark Powering a snake that is standing on a scroll kills the snake and
makes the scroll disappear. FIXED.
* BUG: Creature died on scroll. Scroll was still there. I collected the
scroll and moved away but the corpse was not there anymore! THIS IS NOT A
BUG, JUST A LIMITATION OF THE GAME, sorry.
* BUG: snake stands on dead vampire. Justice Snake regenerates a living
vampire rather than an undead vampire. ERADICATED.
SAI: I actually knew about this, thought it would be a good trap for
young players :-)
JC: Yeah, I went back and reread this section a few weeks after I changed
this and I thought to myself: "Hmmm... maybe I shouldn't have done that?
Oh well, its done now." Should we make some sort of rule about this?
* BUG: Play a game with 99 scrolls. Start a new game. After ScrollDelay
turns NOBODY is awarded jillions of spells from many (but not all) blank
spaces on the board. Traced this to a problem in ClearBoard(); NOW FIXED.
* BUG: Generator Scroll just generated a Hydra. This was so hilarious that I
almost left this bug in the game... oh well, I FIXED it.
* BUG: I was riding a unicorn and I cast reincarnate on my unicorn.
I was surrounded by enemy monsters, they killed my unicorn and it
reincarnated into a spider then they killed the spider and it became
a beetle then a goblin killed the beetle and stepped onto the square!
I could still cast spells but I couldn't dismount the independent
goblin. This goblin also had an identity crisis; each turn when I
clicked on the "end turn" gadget; this goblin would attack independent
creatures for me all on its own. But when it was the
Independent's turn it would act like an independent goblin and attack
my creatures. I made a small correction to Reinstate() and tested it
so this is NOW FIXED.
* BUG: I killed 5 things with my WoodElf and it sure enough became a
DreadElf but it belonged to NOBODY! FIXED.
* BUG: I killed 7 things with my GreenDragon and it became an Emerald
Dragon belonging to NOBODY. FIXED.
* BUG: I killed 20 things with my RedDragon but it didn't give me a Vampire
Spell. FIXED.
* NOTICED: that due to all of our code cleanups, the Vortex no longer
leaves a trail of distorted space in its wake. I suppose this is for the
best. I guess we should change the spell description accordingly?
BUG: Trying to use the menus at the VERY beginning of the game before it
has time to say "Player 1" results in a machine crash. Leaving this one
for SAI.
SAI: I got a recoverable alert. I have been unable to fix this. I not
sure why it happens, esp. with the tick menus as they are completely
controlled by Intuition. Perhaps it is something to do with clipping?
Jeeps. It even does it if you just use the RMB and don't actually
select anything! May have found the problem, I was getting timeout
messages for window events---this is a potential memory leak.
No, I have now discovered this problem is caused by doing too many
ReleaseSemaphore operations. Somehow MENUVERIFY is not set at
this early stage, and therefore the semaphore never gets locked.
I have patched this problem by checking the semaphore status before
attempting to release it. This work, but it is technically illegal
because it makes an assumption about the Semaphore structure. Looking
at HandleIDCMP it badly needs to rewritten, even has a goto in it
at the moment! NOW FIXED
At the beginning of this next upgrade I had already made countless changes
to every source code file including lots of spell files and even msg.tex so
I went on ahead and made more changes by implementing the following:
***************************************************************************
***************** SOURCE CODE READABILITY UPGRADE *************************
***************** PART I: PROTOTYPES *************************
***************************************************************************
* Sunday: Completed Audio.tex through move.tex. I'll do the rest tomorrow.
* Monday: Completed through part of prog.tex then had to go to work. 8(
* Monday Night: Completed through start.tex then passed out.
* Tuesday Morning: Completed all .tex files + tex2c.c.
* Replaced all prototypes with complete versions.
* Eliminated several duplicate prototypes.
* Various other code cleanups.
No more Function(int,int,int,int,int);!
All prototypes replaced with the form of:
Function(int SourceX, int SourceY, int DestX, int DestY, int iterations);
***************************************************************************
***************** SOURCE CODE READABILITY UPGRADE *************************
***************** PART II: SYNTAX *************************
***************************************************************************
***************** NEW PROGRAMMING LANGUAGE: JC ***********************
***************************************************************************
I got sick of the lameness of C so I invented a new language called JC.
JC stands for "James' C", "James Conwell" and "GET THOSE GAWDAM FUCKING
PIECE OF SHIT LAME-ASS BRACES {} OUTTA MY FACE!" 8)
Have you ever wished C didn't have all those lame curly braces? {}
Then JC is for you.
Have you ever wished C had Array Bounds Checking?
Then JC is for you.
Have you ever wished C would properly indent your source code for you?
Then JC is for you.
Have you ever said "C is the greatest language ever. Its ease of use is
remarkable, its syntax is unsurpassed and its execution speed cannot be
matched by even the best assembly language programmers"?
Then you are seriously deranged and JC is not for you.
Here are the specifications for JC:
1. It is exactly the same as C, with the following exceptions:
A. Braces {} are only used to define Arrays and Structures, or in a case
block to create some new temporary variables.
B. You can use "and" or "AND" instead of &&.
C. You can use "or" or "OR" instead of ||.
D. IF statements end with END_IF and need not contain any braces {}.
E. FOR statements end with NEXT and need not contain any braces {}.
F. SWITCH statements end with END_SWITCH and need not contain any braces.
G. DO_WHILE(condition) blocks can end with LOOP or LOOP_WHILE(condition)
or LOOP_UNTIL(condition).
H. DO_UNTIL(condition) blocks can end with LOOP or LOOP_WHILE(condition)
or LOOP_UNTIL(condition)
I. Functions begin as usual with the type of return, name of function
and parameter list followed by the keyword FUNCTION which begins the
FUNCTION block. The FUNCTION block is terminated by the END_FUNCTION
statement.
J. You may have a WHILE condition or an UNTIL condition at the top of a
loop, the bottom of a loop or both via DO_UNTIL/DO WHILE and
LOOP_UNTIL/LOOP WHILE thus you can have a loop like:
DO_UNTIL (x<0)
blahblahblah();
LOOP_WHILE (z!=y and z!=1)
2. JC is easily transportable to every computing platform on Planet Earth.
(or at least those which have C compilers.)
3. JC has the option of properly indenting your source code.
4. JC has the option of generating additional code for Array Bounds
Checking. (Not yet implemented.)
Why is C so lame?
I could write an entire book documenting all the reasons why C is a lame,
obnoxious, crappy, primitive and barbaric language; however, I will only
write about those problems which are fixed by using JC.
I have wasted countless hours trying to debug large, complicated programs
which are very deep. "Deep" meaning deeply nested ifs within ifs within
elses within fors within switches right next to other ifs within fors with
elses within ifs within other switches, etc.
The reason for my wasted time is simple. The following symbol is nearly
meaningless "}". The close brace doesn't tell me jack about what is going
on in the program. It's definition is so completely vague that it makes
reading a program and debugging it very confusing. } means "end a block of
code". Well, whoop-dee-doo. What the hell kind of block is it
ending??!?!?!? _Which_ block of code is it ending?!?!??? You just don't
know. It could be ending a FOR block or a SWITCH block or an IF block or
an elseif block or an ELSE block or ...
In JC a FOR block is ended with NEXT. A SWITCH block is ended with
END_SWITCH. An IF block is ended with END_IF.
Thus when you look near the end of a large function instead of seeing this:
}
}
}
s=0;
}
}
}
You will be able to see some text that actually has real meaning.
IF you start a block of code THEN you must end a block of code. This is
logical, proper and grammatical. No more constructions like:
if (x)
Blahblahblahblahblah();
You should rewrite it to be all on one line or like this:
IF (x) THEN
Blahblahblahblahblah();
END_IF
This is absolutely neccessary so the JC syntax checker can verify that all
of your blocks of code match up properly.
If you don't put an END_IF at the end of your IF block then how will the
syntax checker know if all your IF blocks line up properly??? It will
think that you forgot it (which is the purpose of JC, to catch those times
when you forget something).
IF you start a block of code THEN you must end a block of code. This is
logical, proper and grammatical.
SHORTCUT exception: You may have SINGLE line IF statements where the ENTIRE
IF (condition) statement(); is ALL on 1 line. So you still have a shortcut
for simple IFs. This shortcut should OMIT the word THEN or it won't
compile correctly. Of course, all multiline IFs must include the THEN
keyword.
If you want your IF statement to use more than one line then you MUST use
END_IF. That is the rule. And it makes the program easier to read. And
it allows the syntax checker to find those obnoxious bugs in deep code and
it allows the JC formatter to properly indent your source code.
END_IF, NEXT and END_SWITCH should be located on a line by itself, as the
whole purpose of these keywords is to aid human readability and the only
way we can accomplish this is for the end block markers to stand out from
the crowd.
Here are some examples of C code vs. JC code:
C:
if (x) DoThis();
JC:
IF (x) DoThis();
C:
IF (x) {
DoThis();
DoThat();
}
JC:
IF (x) THEN
DoThis();
DoThat();
END_IF; <--- Semicolon optional.
C:
IF (x) {
DoThis(); DoThat(); DoTheOther();
}
JC:
IF (x) THEN
DoThis(); DoThat(); DoTheOther();
END_IF
C:
IF (x){
DoThis();
DoThat();
DoTheOther(parameter1, parameter2, parameter3, xyzzy, plugh, parameterZ, weird);}
DoSomethingElse(blahblah);
return(returnvalue);
JC:
IF (x) THEN
DoThis();
DoThat();
DoTheOther(parameter1, parameter2, parameter3, xyzzy, plugh, parameterZ, weird);
END_IF
DoSomethingElse(blahblah);
return(returnvalue);
C:
switch (code) {
case 1:
blahblah();
case 2:
blahblah();
}
JC:
SWITCH (code) <--- Notice there is NO brace! {
case 1:
blahblah();
case 2:
blahblah();
END_SWITCH // (code)
Given that over 95% of the Earth's literate population does not know what
"&&" or "||" mean; it utterly boggles the mind to try to conceive why C uses
"&&" to mean "and" and "||" to mean "or". Over half the world's literate
population knows what "and" and "or" mean, and 100% of the Earth's
English-Speaking population knows what "and" and "or" mean.
Given that the & is used to derive the address of a variable, to logically
and bits together AND to mean "and" in the case "&&" we can see that the &
is really overused so && has been replaced with "and" in JC.
Ditto for || and "or".
Of course now that I have been seriously coding in C for 1.5 years and
occaissionally coding in C before that; I am now used to the && and ||.
However, I would have learned C years before if it had used standard "and"
and "or" notation.
Implementation in Chaos:
Since Chaos already transforms the original source code into real C code
via tex2c there is no reason not to expand its functionality to trasform JC
source code into plain C source code. As it transforms the code it will
perform error checking to make sure that your NEXTs match with FORs and not
with an IF or a SWITCH, etc. The code will also be properly indented.
Major problem discovered with C macros:
FOR(i=1,j=1;i<=wizards[p].BonusArrayPointer;i++,j++)
The FOR macro won't work in the above example due to the , (comma) meaning 2
different parameters. So we must find a way to make a macro work with any
number of parameters. Either that or JC will have to preprocess the files
like tex2c does.
Or I could just rewrite the FORs to have i=1; j=1; right before the FOR.
NO that doesn't work because there is still i++,j++ at the end.... hmmm...
Changing FOR to take 10 parameters doesn't work either. The macro wants
EXACTLY the number of parameters that have been defined for it.
Due to lameness in the C preprocessor there is no way to #define a macro
whereby EVERYTHING within the parenthesis () is considered to be just 1 big
parameter; therefore, I cannot implement FOR NEXT loops in a simple manner.
I must either preprocess the code and translate from the source file to a
new file or I can make up a DO keyword and continue to do everything within
tghe confines of #define statements. The latter course of action is being
taken at this time. So a FOR NEXT loop must look like this:
FOR (x=0;x<25;x++) DO
blahblahblah();
NEXT
Sorry about the above inconvenience.
Luckily much of the work of implementing JC can be accomplished with clever
use of #define macros.
This has the advantage of working perfectly with the C debugger.
ARRAY BOUNDS CHECKING has not yet been implemented. I have worked out the
basic algorithm for implementing it but I have had numerous personal
problems with work, my car breaking down and I had to move to a new house
then I got sick, so I have accomplished very little in the last month.
Therefore I will implement the array bounds checking either A) When it
becomes extremely important or B) whenever SAI has a lock on the gamecode
and I have nothing better to do. In the meantime I will begin implementing
things which I hope are more important and more fun.
*****************************************************************************
**************** END NEW PROGRAMMING LANGUGAGE: JC **************************
*****************************************************************************
* Test Macro(x) vs. Macro (x) Will it work? YES!
* Thursday morning: Upgraded Audio.tex to new JC syntax Then had to go to
work all day.
* Friday morning: Upgraded Bonus.tex to JC.
** BEGIN 3 days off:
* Saturday Morning: Upgraded Cast.tex to JC.
* Saturday Evening: Upgraded Cell.tex to JC.
* Sunday Morning: Upgraded cmove.tex, core.tex, graph.tex, part of editor.tex.
* Sunday Evening: Upgraded info.tex, init.tex.
* PLAYED a test game: Everything basically works ok.
* Monday Morning: Upgraded menu.tex and move.tex to JC.
* Monday Evening: Upgraded msg.tex, pointer.tex, pool.tex (lots of editing
to the tex of pool.tex.
* Played a test game: everything seemed to work ok, but at some point the
Independents had a score of -11. How is that possible?
* Upgraded pool2tex.tex and predicate.tex to JC.
* Tuesday Morning: Upgraded 75% of prog.tex to JC then had to go to work.
** END 3 days off 8(
* Wednesday Morning: Finished upgrading prog.tex. Finally!
* Thursday Morning : Upgraded score.tex to JC.
* Friday Morning: Upgraded spell.tex to JC
* SUSPICIOUS: I noticed some code in IntelligentComputerSpellSelect() that
disables the .necro or .forgot but there is only 1 chance in 32 of it
happening. There is similar code in GetSpells()
Begin 3 days off:
* Saturday morning: Upgraded start.tex, text.tex, warp.tex, flashywin.c to JC.
* Played a test game: Everything seemed to work just fine except for:
* BUG: when a creature ends it movement the "Range = X" line of
WriteNearBottom is not erased. FIXED.
* BUG: I was playing a game and there were no indpendents left alive.
After I went the computer said "INDEPENDENTS" and them immediately started
making lots of bonus spell noises and stuff. This was caused by the
awarding of bonus spells from manabatteries etc. So there needs to be
some sort of notification that the game is processing the update phase and
is NOT still doing the Independent movement. FIXED.
* BUG: The Repulsion spell does not repel scrolls properly. Sometimes there
is a cell which contains nothing while the underpart contains the scroll
that used to be there. This results in NOBODY collecting lots of free
scrolls from empty cells. FIXED.
I intentionally skipped over SPELLMAN.TEX because AFAICR I
havent made any changes to this file. I'll try to leave it untouched in case
SAI has made any changes to it during the past 2 months while we have been
out of communication.
* Saturday Evening: Upgraded io.tex to JC.
* Sunday Morning: Upgraded editor.tex to JC. YAHOO! All main program files
are now upgraded to the new syntax!
* As I was upgrading all of the above files I corrected several places
where an else appeared to be associated with a particular if based on its
indentation but in fact was associated with a completely different if.
I fixed them as I noticed them. I left millions of other indentation
errors for the JC formatter to fix automatically.
* FLAW: Abduction spell abducts artifacts then the artifact owners are
immediately recalculated in the update phase so the net effect is nil.
NOW FIXED: Abduction no longer targets artifacts.
BUG: I somehow did the menus too fast for the editor and the game sort of
locked up. I couldn't get the menus to work anymore. I was stuck and
unable to do anything. Leaving this for SAI.
SAI: Probable symptom of ReleaseSemaphore in the wrong place. Or else
a double Obtain if two consecutive Obtains.
* I only upgraded the first 2 spell files (Abduction & AcidRain) to JC.
I will either leave the rest of the spell files for SAI or I'll do them
some other time. Right now I need to work on the formatter.
Sunday:
* Joseph came over and we played a test game
* BUG: Plasma Beam locked up the game. (oops a misplaced END_IF) NOW FIXED.
* Put in some simple IFs to reduce the intensity of the background color
on lissajous squares but this seems to have completely stopped the background
color cycling 8(
* COOL! I FINALLY found the bug in my lissajous background color cycler!
Now it does more or less what I had intended it to do!
Monday:
* Banged together a simple JCformat proggy. Doesn't have any really fancy
features yet. Doesn't handle everything.
End 3 days off. 8(
Tuesday: Work on car. Go to work. 8(
Thursday July 2nd, 1998: My psychotic bitch mom STOLE my car and now I can't
go to work! I was supposed to work all day today and make $100.00. I will try
to do some programming but I am so upset I doubt I'll be able to concentrate.
* SUCCESSFUL TEST: I used JCformat on chaos.c and near the end of the
program I noticed that the indentation was off. This is what happens when
something is mismatched... In this case it was an IF-THEN-END_IF problem.
So even without strict alignment checking, the formatter can "detect" and
show you where code structures don't match up by the fact that the
indentation is OBVIOUSLY wrong.
* SUCCESSFUL TEST: JCformat on flashywin.c like this:
JCformat flashywin.c flashywin.jc
This produced a perfectly indented file that looked great to the naked eye.
I then tested it with:
diff -w t:flashywin.c t:flashywin.jc
NO DIFFERENCE reported.
Then I did JCformat t:flashywin.jc t:flashywin.jjc
(I formatted the already formatted file)
cmp t:flashywin.jc t:flashywin.jjc says "Files Compare ok".
So they are byte-for-byte identical.
* REPEATED ABOVE TEST on chaos.c. Works perfectly! YAHOO!
Well, here's the deal: I've used 2 character indentation on all my zillions
of TrueBASIC programs over the years and I loved it. 2 characters is the
minimum amount to be easily seen by the eye and it keeps my program
listings from going off the edge of the paper in those deep nests with long
lines in them. I really like 2 character indentation because I like all of
my lines to be 140 chars or less because that is what I like to print my
programs out at. Sometimes I use 160 characters per line (Courier 6
point).
But the Chaos source code had many places with 4 character indentation and
some blocks of code had 6 characters of indentation! So switching from
that much indentation to only 2 chars seems like a bit of a shock and it
seems harder to read. I honestly don't think it _is_ harder to read I
think it just _seems_ that way because we are used to something different.
Anyway I am breaking with tradition and using 3 chars of indentation as the
standard default. This should be an ok compromise I hope.
If you don't like it you can always reformat it anyway you like. It only
takes a second to reformat a file.
Consider BEGIN_STRUCT and END_STRUCT macros.
Consider DO_FOREVER and LOOP_FOREVER macros.
* PATCHES INSTALLED: I have downloaded all the SASC patches
from Aminet and have installed them:
sc655pch.lha biz/patch 1.0M 176+SAS/C V6.55 bug fix for Amiga SAS/C 6.50 and SAS/C 6.51.
sc656pch.lha biz/patch 191K 144+SAS/C 6.56 Patch (requires 6.55)
sc657pch.lha biz/patch 595K 89+SAS/C 6.57 Patch (requires 6.56)
sc658pch.lha biz/patch 668K 49+SAS/C 6.58 Patch (requires 6.58)
* SCREWEY BUG ELIMINATED: Now that I am using the latest version of the C
compiler that screwy bug that prevented us from compiling init.c with
optimize=on has disappeared! YAY! Now that I am compiling init.c with
optimize=on (for smake release) it is saving us 728 bytes on the
executable filesize!
*****************************************************************************
**************** SOURCE CODE READABILITY UPGRADE **************************
**************** PART 3: DEBUGGING **************************
*****************************************************************************
Problem: When looking at the code in the debugger it looks completely
different from the real source code due to the fact that all the cool tex
comments have been stripped out.
Problem: Errors during compilation are reported at line number x, which has
no relation to the line number of the source code due to the fact that all
the cool tex comments have been stripped out. Thus the line number given
is often 100+ lines wrong.
Since it is highly desirable to be able to see the program documentation in
the degubber while debugging, we must not strip out all of our tex
documentation.
Solution:
1. The tex will no longer be stripped out.
2. tex2c will no longer be used.
3. A seperate program, c2tex can be used to generate a tex file.
(Leaving the coding of this proggy to SAI but it will be easy.)
4. Edit all makefiles to eliminate the use of tex2c.
5. Change all occurences of
\section to /*\section
\end{verbatim} to /*\end{verbatim}
\begin{verbatim} to \begin{verbatim}*/
6. No more .tex files used in compilation. Only .c and .h files.
Thus all tex documentation will be embedded in C comment blocks. Thus there
is no need to strip it. Thus we can read it in the debugger.
This has the side effect of making the source code take less drivespace,
since there is only 1 copy of each source file, rather than 2 copies.
* Transformed and eliminated audio.tex, bonus.tex, cast.tex, cell.tex,
cmove.tex, core.tex, editor.tex, info.tex,
Upon recompiling init.tex I found a horrible bug that crashes the game
every time. I checked some old versions of the code (2.2 and 2.1) and the
bug has been there for ages. Funny how it never crashed the game till now.
Anyway, it is FIXED now.
Transformed io.tex, menu.tex, move.tex, msg.tex, pointer.tex,
predicate.tex, chaos.tex, score.tex, spell.tex, start.tex, text.tex,
warp.tex.
As a result, numerous files which were once combined together into large
.tex files are now their own standalone file. e.g. edmenu.dat, menumaker.c,
and others.
* I didn't convert pool2tex.tex, graph.tex or pool.tex yet since I
presumably don't have to debug those and I am anxious to get back to some
real coding.
* INSTALLED MUNGWALL & SUSHI: I was having a nasty random bug in JCformat
so I installed MUNGWALL & SUSHI to try to find it. It showed me the bug on
the 1st try. I was writing 1 byte beyond the end of my allocated memory.
*****************************************************************************
**************** END SOURCE CODE READABILITY UPGRADE ************************
*****************************************************************************
Jerry came over and we played a game that lasted all night long. We each
made our fair share of good and bad moves throughout the game. For most of
the game Jerry had been winning like crazy. This is partly due to the fact
that I waited and waited and waited till the last possible moment to use my
Invert spell then things started to change. A few turns later and I was
definitely winning. I could have won the game but then I got tired and
made an INCREDIBLY stupid move. My wizard was in a tree and the tree
collapsed. I had Magic Wings with 5 movement and LOTS of safe places to
move to. But instead I hopped into the next tree. BAD MOVE. The next
tree only had *1* life point and my wizard had only 10 life points. And
seeing as how that 1 particular square was one of the few on the board
where Jerry could attack me with 2 creatures at once. I got killed. Darn.
My Iridium horse had been really kicking some ass....
I wouldn't have died if it hadn't been for the fact that Jerry had control
of the only artifact on the board. If not for that artifact my last move
would have been nothing more than an insignificant mistake. But as it
happened I got killed. This is the 2nd human vs. human game I've played where
artifacts were directly responsible for the outcome of the game.
We played with 4 buried scrolls and 4 buried artifacts with scroll delay of
3. No Texas Trash'em. 6 computer wizards.
Every scroll we dug up was something really cool. I dug up an Iridium
Horse Scroll and a kill scroll. Obtaining the scrolls was quite
challenging because it took several turns to dig them up and then 3 more
turns to collect them.
One interesting event in the game occured when a mounted computer wizard
cast a Shadow City next to himself but refused to enter it. My wizard had
magic wings with 5 movement points + Elf Boots + Combat + Recover Boost
so I immediately began to cross the entire board to get there. It took 5
turns to make it inside the Shadow City. I took a lot of damage along the
way. My brother thought I was crazy for charging my wizard off like that.
It ended up being well worth it. I got to pick 3 great spells from a list
of 10! Awesome!
There were several turns in the game where I had to REALLY strategize
seriously in order to keep my brother from running me over.
Jerry cast a Tempest which really made the game exciting. First it came at
me and charged into my group of creatures and scattered them out one by
one. Jerry then used his group of creatures to kill them off one by one
since they had no backup and were isolated from their buddies. This left
me VERY weak.
But a few turns later and the Tempest went into Jerry's territory and
started scattering his creatures in a similar fashion so this evened things
up somewhat. What a great game.
Here are the bugs we found:
Jerry cast a cat lord and the cat lord immediately cast a Jaguar but the
Jaguar allegedly never moved (several turns) till Jerry killed the Cat Lord.
The cats which were already on the board when the Cat Lord was cast all worked
like they were supposed to. They moved around and killed things, etc.
Unfortunately I didn't pay that much attention to it. I think the Jaguar
may simply have been sitting by a pool the entire time.
SAI: I find this very hard to believe. Most likely the computer just
decided there was no benefit in moving it.
* TEMPEST BUG: Jerry cast a Tempest whose Life Force and Recovery and Combat
kept mysteriously rising. Furthermore, it managed to accumulate several
Foes Killed every single turn even though it never killed anything. And
this happened whether it teleported something or not. By the end of the
game it had 54 Foes Vanquished.
Ok I have determined that Tempests were "killing" every empty cell that
they moved onto and they were also "killing" every dead body that they
were moving onto. Presumably, killing an empty cell was its favorite
food and that is why its stats were raising so high.
TEMPEST BUG FIXED.
* BUG: Sleeping Tempests could still move. FIXED.
* IMPROVED SCROLLING: Due to a misunderstanding of arcane timing lore, the
scrolling of the screen in the intro was, in fact, only executing at 25 fps.
It now runs at 50 fps for faster, smoother operation. Unfortunately, the
scrolling jerks a little bit each time the OS does something for 1 frame.
* SCROLLING now at priority 50. This fixes the above occaissional glitches
for nearly all situations.
* INSTALLED ENFORCER in my User-Startup so it will always be running from
now on. "enforcer stdio"
* Paid $165.00 for a unix shell account for 6 months. They then REFUSED to
send me any info about how to access my unix shell account. But they did
tell me how to get into my ppp account. I have asked them repeatedly and
they simply will NOT tell me how to access the unix shell account. Damn
bastards. I have spoken to some people who do not work for this ISP and
they are of the opinion that the unix shell account CANNOT be accessed
without first logging into the ppp account! ARGH!!!!
* NEW HARD DRIVE purchased and installed. It is a 4.3 gigabyte Quantum
Fireball SCSI drive that cost me $300.00. I now have ROOM! YAY!!!
I can actually _install_ software on my Amiga!!!!!! Coolness!
* INSTALLED MUI 3.6 + Miami 1.1 + AmFTP 1.89a and everything worked great on
the first try! However I was having probs with ftp transfers so I upgraded
to the following:
* INSTALLED MUI 3.8 + MIAMI 3.0 + IBROWSE 1.2 + AmFTP 1.89a + WorldNews1.0.
NOTES: Hotmail won't let me send attachments with Ibrowse.
Miami 3.0 is MUCH more difficult to install than 1.1 was. 8(
Installing all this new software made no difference to my ftp
transfers. Every ftp site on earth seems to work perfectly
except for 1. It just doesn't work right no matter what I do.
Luckily this is irrelevant.
* I am now on the net with a ppp account. This sure makes uploading and
downloading a lot easier.
I still need to install an Email proggy.
I still need to install Directory Opus Magellan. It is supposed to be the
ULTIMATE piece of software. It is supposed to be the BEST for ftp and the
BEST for viewing and adding/deleting files from/to compressed archives and
millions of other things.
* Put in 3 different MeltScreen effects. There is a problem in knowing how
to redraw the right hand side of the screen after this effect.
I don't know how to solve this.
* Biohazard now uses the MeltScreen(SINK) effect.
List of spells that might go well with the MeltScreen effect.
*meddle, mutate, *dissection, acid rain, disrupt,
I want to use MeltScreen(SUCK) with devastation but I don't want the screen
to be redrawn until after all the appropriate cells have been
killed/reinstated. So how should I do this?
A) add a REDRAW option to MeltScreen. Then call MeltScreen(NOREDRAW) then
manually redraw the screen in the .spl file.
B) add a "function to be called before the redraw is done" option.
If this function address is not null then it will be called before any
redrawing is done.
I implemented option B but then I realized that this wouldn't work because
the spell handler needs access to some variables so I am making all those
variables STATIC and moving CastFreeSpell and CastMagicSpell near the end
of cast.c. I couldn't think of any disadvantages to doing this. (Not that
my judgement is any good right now since I am still extremely sick at the
time of this writing.)
This now means that we are 1 small step closer to being able to have
seperately compiled spell handlers since each spell handler can now be its
own seperate, independent function with access to all the game's global
variables + these few semi-global (STATIC) variables such as id, player, p,
b, wizardsp, wizard_cell and w_stat.
I am not saying that we 100% want the capability to have seperately
compiled spell files but it would be nice to have that _option_, should we
decide that it is desirable.
* Devastation now uses MeltScreen(SUCK)
I didn't pick a spell to use MeltScreen(SWIM). I'll leave this for SAI.
* WaveScreen effects: You can now make the entire screen wave with
StartWavyTask(screen,1); Small numbers mean more radical waving. Larger
numbers mean very gentle waving. I implemented this as its own task
because this effect can be used WHILE WE PLAY THE GAME AS USUAL. Kewl!
Of course if you don't want it waving the screen in the background just
do: StartWavyTask(screen,1);
WaitTOF(80); // wait however long you like, set vars, call functions, etc.
StopWavyTask();
In general we will want to use the WavyScreen effect in the above manner.
But for Vodka spell I want the effect
to last for the entire duration of the afflicted player's turn.
I am not in "graphics design mode" right now so I leave the
graphical design of the above spell to SAI.
Here is roughly how it works. You cast the spell on a player.
This sets the appropriate wizard bit ala BattleCry etc.
At the beginning of the afflicted person's movement phase we
StartWavyTask(screen,2);
If the drunkeness bit is set then all his creatures do only half
damage. (Just modify the combat routine to check for that bit and then
>>1 the damage.) At the end of his movement phase just StopWavyTask();
and clear the drunkeness bit. VOILA! 8)
This effect normally doesn't take many cpu cycles, however since we have
2 visible screens on our display it probably slows down the computer
noticeably.
However it DEFINITELY does not slow down the computer any to wave a 64
color screen instead of a 2 color screen. Either way the screen waves
instantly on command due to the power of the copper.
* Bless and Haste now utilize the WavyScreen effect.
Doing the screenwave effect + the screenmelt effect simultaneously looks
extra gross in a horrific sort of way.
???? I just edited the description of Arborist and saved it. Then I did
smake newspell. But the game is still using the old description! 8(
spells.tex has the new description but the game doesn't!
pool.ssc is dated June 30th, 1998. This is August 24th. pool.ssc hasn't
been updated all this time! 8(
In an attempt to fix above problem I threw the following lines into the
makefile: (SAI should look at the makefile to see if it is in correct order.)
pool.ssc: pool.txt sencode.o
sencode <pool.txt
ok, that didn't work. I'll leave this mysterious matter to SAI. I just
don't know what all these different things do (sencode, decode, ae, ad,
single, fixfreq... AUGH!!! I guess I really broke something somewhere.)
SAI: ALLEGEDLY FIXED this problem.
Made various other changes to the makefile but no luck. 8(
Dear SAI: How about whipping us up a green square Image and a pink square
image so that we can show damaged movement on the info screen similar to
the way all the other stats are shown? Thanx. (remember the colors on the
hires screen are different from the colors on the lores screen.)
SAI: Modified DrawSquares so you can use any HIRES screen colour that
you wish. DONE
* Reduced the probability of Bipedal Generators.
* Changed NOLOADORSAVE to be NOLOAD and removed the appropriate #ifdef NOLOAD
references from the code. This way the demo game can be played and
saved. Then when they get the registered version they will allegedly
be able to load in their saved games and continue.
* FLAW: the 2nd menu strip (CONTROLS: Speech, Sound, Impurities etc.)
does not highlight correctly. This dates all the way back to v1.0
FIXED.
* FLAW: Something about the game that has always really bothered me is
that there was no way to know what turn it was. Grrr... When I play
a long long game I have no idea how many turns I've played. I like
to know what turn it is so that I know about how many spells I have left
and because sometimes I play a ridiculously hard game just to see how
many turns I can survive. FIXED. The turn # is now displayed on the
Scores Screen.
* ADDED the saving of TurnCount into the header block of io.c so now
the Turn number is properly saved and loaded.
* BUG: I killed a Bird Lord with my mounted hourse and it was promoted to
a Nightmare then immediately to an Iridium Horse. FIXED.
However, the IsDragon macros automatically report all mountable
set 2 creatures as dragons. Therefore you can promote a Thundermare
by killing Bird Lords, T-Rexs or Elephants, as well as real dragons.
SAI: I think this is acceptable.
JC: It's ok with me too.
Nothing of consequence done during september.
Absolutely, literally NOTHING done during October and November.
Too busy with work, fixing car, girls.
* Thanksgiving day playtesting. Jerry, Joe and JJ learned the hard way
that if player 1 casts an alliance spell on player 2 then player 3 casts
an alliance spell on player 2 that the first alliance is severed.
We never knew that it worked like that. We should probably figure out
some eloquent way of saying this in the spell description.
* Installed YAM1.3.5 for direct email contact between JJC and SAI.
Hotmail has grown progressively worse ever since Bill Gates took it over.
It just kept getting worse and worse until finally it just plain stopped
working a few weeks ago. I now use YAM for my "real" Email but my
new permanent address is JamesConwell@yahoo.com
Since the makefile seems to change every time we swap the code around,
Maybe we should just forget about smake unarchive and just make a
fresh dir for the game each time we swap control and
"lha x" it then just do a "smake dev". That will guaranteed work
so long as we don't forget to include any files in the archive.
* TESTED
1. smake archive
2. put the archive in a virgin dir and lha x #?
3. smake dev
WORKS ALMOST. ALL FILES PRESENT AND ACCOUNTED FOR EXCEPT for
fixfreq isn't getting recompiled by the makechaos file.
I guess the dependencies are in reverse order or something.
Leaving this for SAI to fix. NOW FIXED
* I just burned a floppy version of Chaos 2.3df and the disk is
100% FULL. Looks like I cut it real close. Good thing I eliminated
all that code and did all those optimizations. Every little bit
actually ended up making a difference.
* UPLOADED version 2.3d to Aminet.
December 1, 1998: ReleaseSemaphore(&SourceCode) by JJC
END OF VERSION 2.3
BEGIN VERSION 2.4
* Fixed printf format bugs in sm.c, pool.tex.
* Made sm, reincalc, work under Unix.
* FIXED the problem with the generation of the "rein.h" file. I was
deleting the file before it had a chance to be used. The program
"reincalc" is only used to produce a table of reincarnation numbers
for inclusion in the manual.
* FIXED type errors in decode.c, sencode.c, and graph.tex
* Stopped "graph.tex" from including inutition.h unnecessarily.
* Allegedly fixed menu recoverable error problem. This fix is not
to my satisfaction and I will try and find a better solution. NOW FIXED
* Allegedly fixed the makefile problem with generating pool.ssc.
* REMOVED sound effect from BioHazard.spl (I don't feel this was
necessary with the new screen effect).
* CHANGED: The eye-eye powerup now only gives 2 counts instead of
5, but its effect can now be accumulated by casting the spell
multiple times.
* Added MOUNTABLE2_STAT to the Shadow Dragon.
* Modified DrawSquares in info.c so that we can draw squares in any
colour.
* Modified the movement and range stats to show the original value
in red (i.e. like all the others stats) and the current value in
green. I didn't do anything about recovery for movement.
* Added a few new random messages for wizard spell selection.
=== Improvements to JC language ===
* ADDED support for DO_FOREVER loops to JC (replaces DO_WHILE(1))
* Added formatting for multiline /* comments. All such comments
will now appear thus:
/*
blah blah blach ................................... black heep
toxic fumes kill wizard blah blah bvlah
*/
That is, the /* and */ appear on lines by themselves. The text
in the comment is automatically word-wrapped at 75 characters
(taken accounts of spaces of course). New paragraphs can be
forced with two returns (as in most of our files). Finally,
lines starting with * in a comment are passed through as is.
This allows for lists to go through without formatting errors.
I would have liked to indent the comment text a couple of spaces
but I couldn't think of any easy way of doing this using my
curret strategy.
None of this affects /*-style comments on a single line.
Someone still needs to do something with // style comments.
I suggest that if // is the first thing on a line, then that
line should be indented with the current indentation.
I haven't test this on every file yet, so there might still
be a few problems.
Note from JC:
The above strategy has some unfortunate flaws.
1. It destroys my "outline style comments"
2. It destroys blocks of code which have been temporarily
commented out.
3. Most comments are already properly word-wrapped.
4. You can word wrap a paragraph in Cygnus Ed Professional by simply
placing the cursor at the start of the paragraph and selecting
format from the menu. You can format with or without fill.
Therefore: I am changing it so that the auto word-wrapping
ONLY happens on blocks of code that start with /**
Hopefully that is good enough. Perhaps we should make it /***** or
something?
* NOTE FOR JAMES: NULL, 0, and '\0' are three diffrent concepts
and it is just by chance (design?) that they have the same
value on most platforms. I have used computers where NULL!=0
(VAX 370 for instance). Futher NULL is a 32-bit quantity
on the Amiga, whereas '\0' is only an eight bit quantity.
More sophisticated compilers will complain about incorrect
usage.
Therefore please use NULL only for pointers and '\0' to
mean the nul character. At the moment you often use 0 for
this function. Further it is better to write '\n' than
10 for end-of-line since code using 10 will fail under
DOS, Cray, or Mac because of different line-ending
conventions. Using '\n' should work for all platforms
(POSIX standard).
* Added a few extra bits of code to JC-Lang so that it will work
under a standard Unix environment. I needed this because I
often test chaos stuff under Linux. A good reason for this
is that make/gcc on Linux can churn through the entire
spell-manager part of building in Chaos in under 15 seconds,
yet this takes about 30 minutes on my Amiga.
JC: You are racing a 1997 linux CPU against a 1987 Amiga CPU.
The 68030 was introduced in 1987.
* I think we should completely phase TeX out of the source code
now that we have a decent automatic formatter. ??
JC: I don't care if we "phase TeX out" or not, but I would
like it if you phased out the other .tex files so that all files
are real code files.
* RENAMED: JCformat.jc to JCformat.c for Unix compatibility.
* ERROR: Just discovered Intuition defines a looping structure
using FOREVER. Therefore I have renamed the JC equivalent
to DO_FOREVER. If only the Intuition one had a { at the end
of the definition all would have worked fine!
=== end JC-Lang improvements ===
* Removed all .obe files from the game. Created .raw files for
those .obe files which did not have .raw files. This saves
a fair bit of space in the development directory, and archive
file although makes no difference to the compiled program
size.
* Modified the info panel so that creatures having the REIN
bit set, show the number of reincarnations steps remaining
in their sequence (previously just an `R' was shown).
=== Start of input handler upgrade ===
* Completely rewrote HandleIDCMP with the aim of making it the
sole place in the program to handle IDCMP events; although
I have not yet incorporated the editor functionality into it.
In the process I eliminated a few horrid global variables,
I wish I could get rid of more of them.
There should no longer be any menu selection problem.
There should be less lossage of meaningful events.
Return to end your turn now works much better.
Various highlighting functions are more homogeneous.
The mini-editor is still supported.
* Moved various bits of JC's timing code to the bottom of
the chaos.c file since I didn't want them cluttering things
up while I was doing the new logic.
* Hmmm. Discovered that the existing editing functions are
already using some routines from chaos.c and now there
is a conflict. Oh well, have temporarily turned those things
off in the editor. NOW FIXED
* Incorporated the editor IDCMP handler into the main game
handler, thus moving the one step closer to a single IDCMP
handler. In addition this change shaved 500 bytes on the
size of the code segment.
* Discovered I had accidently deleted the code for the `S' key.
Reinstated it.
====== End of IDCMP upgrade =========
* Modified the image tool to use only raw files. Took the
opportunity to fix all the prototype error messages as well.
* Repaired the Quit option on the initialization screens.
WELL I'M OUT OF TIME. So back to JC.
NOTE: I haven't tested the modified JC formatter as much as
it should have been.
December 24th, 1998: ObtainSemaphore(&SourceCode) by JC:
unlha'ed the archive in a fresh dir and then did smake dev.
This produced a game that did not work due to no pool.ssc file having
ever been created. Ok, I dug around and studied the fixfreq and sencode
and I understand what is going on now.
pool.ssc must be recreated when doing smake anything and pool.ssc does not
already exist.
pool.ssc must be recreated when doing smake clean
pool.ssc must be recreated anytime that pool.txt is newer than pool.ssc
I'm not really sure exactly how this should be put into the makefile.
I just hacked something in and it didn't work.
Tried various different things and I just couldn't get a smake dev to
work from a freshly unarchived archive. No matter what I tried some
mysterious thing wouldn't work.
I hate makefiles.
* FIXED various mangulated comments.
NOTICED: press a number key to highlight your creations.
Press it again and nothing happens. It used to unhighlight.
Is this good or bad?
* BUG: Press a number key to highlight your creations. Press any Mouse
Button. Menus no longer work. This is due to all keys doing a
TrapRMB with no corresponding PassRMB. NOW FIXED.
NOTICED: It always seemed like there was something missing from
Classic Chaos. I just figured out what it was. I have now made
Ropers and Wasp Nests CLASSIC.
* BUG: DO_FOREVER and LOOP aren't matching properly in jcformat. FIXED.
* TESTED the latest jcformat on a couple of files. Very minimal testing.
seems ok.
* Added in medmod support to music.lib. We can now easily play med (MMD0
and MMD1) mods in Chaos.
* Added support for the QuadSpectrumAnalyzers into the medmod asm code.
* Added support for the Quadrascopes into the medmod asm code.
* Solved the mystery of converting period into samples per second
* Rewrote the quadrascopes to use the RIGHT formula now.
* Now the scopes really graph the part of the sample that is actually
being played right that instant. So now the scopes are accurate.
You can really see the difference in speech samples such as "Chaos"
where you can now see the peaks and valleys of the waveform as it is
being played.
* Fixing the formula means that the scopes are now "locked in" to the music
better.
* Implemented a 1000 entry lookup table to convert from the period value to
samples per frame. This saves 2 floating point divisions and 2 floating
point multiplications each time a new note is started. But mainly it
saves me the trouble of doing Floating Point math in asm.
* Tested all 6 game musics with the new system and they all work
WONDERFULLY!
* Chaos now officially supports the playback of protracker and MED MMD0 and
MMD1 mods. If you have a choice then use MMD1. Not that it really
matters. I have no idea which routine is faster, all I know is that MMD1
mod format is superior to protracker mod format due to being able to handle
more instruments and being able to have multiple songs per file.
Hooray for Teijo Kinuunen!
Octamed Sound Studio Professional notes:
Octaves are 12, 23, 34, 45, 56, 67, 78, 89, 9A.
Octave 89 and 9A in OMSSP are illegal. The notes are SUPER LOW.
Octaves 34 through 78 all sound the same
CHRISTMAS DAY PLAYTESTING:
* Designed a 4 player level with an exit in the middle, surrounded by walls.
2 different versions.
1. no generators
2. 4 standard generators.
* ACK! BUG: smake release no longer works. I keep recompiling the program
and it keeps telling me "unexpected end of file" and "semicolon expected"
on the last blank line of the game. Ok, traced this to a #ifdef
DEVELOPER with no matching #endif. NOW FIXED.
It took me a while to figure out the above bug so I was late and in a hurry
and I forgot to take the Level with me. So we played a standard game of
James Vs. JJ with 20 scrolls, 4 generators, 4 artifacts and a 20 turn
limit. This is the very first time that I (or JJ) has ever played with a
turn limit. JJ started the game with 2 vanish spells. He gained another
vanish after a few turns. Plus he grabbed yet another vanish as a bonus
spell. So I spent almost the entire game vanished with no creatures to
move or spells to cast. Needless to say I lost. The only possible bug to
report is that once I highlighted my creatures with "1" and then hit the
end of turn gadget and there was some strange noise during the computer
player's turn. I don't really know if anything bad happened or not. After
this the game continued normally.
* FLAW: Various snippets of level editor code are no longer undef'ed during
smake release. NOW FIXED. This saved 1048 bytes on the size of the
release version.
* FLAW: Selecting "Load" from Setup Screen I produces some problems so I just
quickly uncommented it for now. This saved 100 bytes on release version.
As a general principle I believe that games should have a load option on
the first main screen. I'll just worry about it later because right this
second I'm trying to nuke as many bugs as fast as possible.
* FLAW: exiting from reading a spell description makes a beep. FIXED
* BUSY WAITING LOOP? When using cpr to track down the above bug I noticed
something in HandleIDCMP. The line of code that says:
IF (Wait (HiResWindowWaitBit | windowWaitBit) & HiResWindowWaitBit) THEN
never actually waited. I traced over the code in cpr about 20 times and
never once did it stop and wait for me to touch the mouse or keyboard.
So I am thinking that somehow some sort of windowflag got messed up
somewhere. It has never done this before to me more than 2 or 3 loops.
MYSTERY SOLVED: The trouble was that there is an ActivateWindow(window);
call in the HandleIDCMP code now so I guess that as I pressed return on
the line to execute the line, the window activates before I let off the
return key. The strange thing is I am getting RAWKEY code 196 instead of
68 like the return key is supposed to be.
* KEY RELEASE DETECTION mystery solved! Codes 0 to 127 are key DOWN codes
and 128 and up are key UP (RELEASE) codes. So anytime a rawkey code is
>128 just subtract 128 from it and you have the code that was released.
But please note that keypresses do NOT neccessarily come in pairs of
DOWN/UP codes. If the user holds a key down then we are given a series
of Key DOWN codes, one after the other, with no intervening UP codes.
James Conwell's 10 Commandments of Game Design:
================================================
Any game produced by James Conwell MUST have the following features:
1. It must have an option for more than 1 human participant to play in a
game. I don't care what kind of game it is. It MUST have at least
a 2-player option.
2. It must have a 1 player option.
3. It should have an option for 2 player competitive as well as 2 player
cooperative. 2 player cooperative mode is VERY important!!!!
4. It must have awesome music.
5. It must have a wide variety of awesome music, probably including but not
neccessarily limited to the following:
A. Spooky Music.
B. Rave Techno.
C. Straight Dance.
D. Dramatic Music.
6. It must have an intro that can be IMMEDIATELY exited at any time.
7. It must make good use of the capabilities of the format that it
is presented in/on.
8. It must be FUN to play.
9. We must go through the game and take out everything about it that is
annoying and either remove it or make it optional.
10. It must have good graphics.
The only way I know to stop the flicker of the pentagrams is to either:
A: Figure out a way to do double-buffering that really works.
B: Move the pentagrams to the bottom of the screen. (this is just a work
around)
C: Make the game require OS 3.0 and use those double-buffering routines.
* INVESTIGATED the following examples of double buffering from Aminet.
These are all that I could find:
dbuffer.lha dev/e 3K 95+Easy double buffering of screens
DBuff.lzh dev/src 12K 321+double buffering demo w/source
doublbuf.lha dev/src 7K 171+Eg. of fast OS-friendly double buffering
NBuff.lha dev/src 19K 277+Double bufferung routines example. V2.2
All these examples SUCK because:
1. They don't allocate their bitmaps properly. They use that icky
scatterload approach.
2. They use the slow RethinkDisplay(); technique.
3. The ones that don't use RethinkDisplay(); require OS 3.0+. And since I
am making the game compatible with all OS's it is useless to me.
* DOUBLE-BUFFERING of rastports/bitmaps implemented for pentagrams
(finally!). Now they are rock solid, _except_ for during high CPU load
times (like while downloading from the internet on standard serial port)
During high cpu load they flicker a bit sometimes.
I haven't tested it on A500 yet.
**************************************************************************
******* ADPCM asm routines upgrade *******
**************************************************************************
ADPCM stands for Advanced Delta Pulse Code Modulation.
It is a lossy compression algorythm which is supported by the Zyxel Voice
modems and various voicemail packages.
I intend to use ADPCM audio compression technology to reduce the storage
requirements of the speech samples of Chaos. This is useful for persons
such as SAI who have limited hard drive space.
I do not intend to compress the "sound effects" of the game. Only the
speech samples because there are going to be hundreds of speech samples.
The game will soon have about 10 megs of uncompressed speech which will
be only 2.5 megs compressed.
ADPCM3 is the 3-bit algorythm. It compresses sound to an 8:3 ratio.
ADPCM2 is the 2-bit algorythm. It compresses sound to a 4:1 ratio.
ADPCM3 produces better sound quality but at the expense of taking a lot
more CPU cycles to do it.
ADPCM2 sounds noticeably worse than a standard Amiga sound sample but
speech samples still sound MANY times better than the algorythmically
generated speech of translator.library.
I have NO intention of using ADPCM3 compressed sound in Chaos.
If you want sound quality then don't compress.
If you want small size then compress with ADPCM2.
So there is no need to use ADPCM3. I'm just including it for orthogonality
and because the routine is so small.
The beginning of this upgrade starts with Christian Buchner's
asm coded ADPCM routines as a starting point.
I will optimize them for maximum speed.
* ADPCM2_Decrunch routine
REVISION 1+2 combined together:
For every byte that gets decompressed James Conwell has:
1. Eliminated 6 instructions and
2. Replaced 4 slow instructions with 4 fast ones and
3. Eliminated 4 bus accesses. (*Very* important on A1200 with no Fast Ram) and
4. Eliminated 3 bus accesses for every 4 bytes written.
ACK! I just realized that my main loop is 256 bytes long!
due to the 16-byte cacheline properties of the 020 and 030 this
will almost NEVER fit into the cache. In order to make sure your code
fits in the cache you must keep your main loop down to 240 bytes!
My next revision of this routine will fix this.
REVISION 3:
Main loop now takes only 194 bytes.
Saved 14 cycles per decompressed byte on 68000.
Saved 6 cycles per decompressed byte on 68030.
REVISION 4: was a failure.
I attempted to replace the multiply,add,asl instruction set with a
256 entry lookup table. Since the variable having all the math done
on it is the delta and since a sample is only 1 byte big, I figured the
largest delta one could possibly generate would be 255. So I'd have
a nice little table of 256 words which would save me 78 cycles per
decompressed byte.
Hours later... it didn't work... after investigation it turns out that
the delta is unboundedly large. I ran 2 sound samples through the
algorythm and the delta reached a maximum of 15944!!! Ack.
Stupid algorythm.
Current Standing:
The main loop takes 212 cycles.
So on my standard 22,000 samples per second sounds it will take
4,664,000 cycles per second on an M68000. That is 65% of all available
CPU power just to decompress the audio stream!
REVISION 5:
Ok I figured out how to use the table or do the math the slow way
depending on the size of the delta.
During a quiet sound sample this allows me to save an average of 62
cycles per decompressed byte.
During a noisy sound sample this allows me to save an average of 54.1
cycles per decompressed byte. (save 62 cycles 93.2% of the time, waste
54 cycles 6.8% of the time)
I Strategically layed out the code for maximum speed and minumum size.
This is what I love about coding for the 020 and 030; their 256 byte
on-board L1 Cache. It makes the geographic layout of your code very
important. You must strategically lay out all your branches because
their geographic location in the code is important. Its TOTALLY COOL.
Asm programming is the ultimate strategy game!
Current Standing:
The main loop takes an average of 157.89 cycles during a noisy part
of a sound sample.
So on my standard 22,000 samples per second sounds it will take
3,473,536 cycles per second on an M68000. That is 48.5% of all available
CPU power just to decompress the audio stream!
This algorythm cries out for the power of the 020's barrel shifter
and faster mulu instruction.
I can make an optimized version of this routine for 020+ by replacing
all those add.w d2,d2 commands with the 020+ SCALED index addressing
mode. Such a routine would REQUIRE an 020+ to run.
DRAT! I was all ready to declare this routine "FINISHED" but
unfortunately my main loop is 248 bytes! It will only fit into the
020/030 cache half of the time! 8(
I will now make 2 slightly different versions of this routine.
_000 for 68000
This routine unchanged.
This routine writes its data to chipram a longword at a time. (4 bytes)
This routine runs on any M680x0 series processor.
_020 for 68020 and up
This routine with all the add.w d2,d2 replaced with the *SCALE
addressing mode. This will only speed things up by 2 cycles on 030
so the main reason for using *SCALE is to reduce the main loop size
by 16 bytes from 248 down to 232 so that the main loop will ALWAYS
fit into the onboard L1 cache.
This routine writes its data to chipram a longword at a time. (4 bytes)
This routine REQUIRES an M68020 or higher processor.
NOTE: I have coded many asm routines for use with many C and Basic
programs but this is the very first time I made 2 different versions of
the same routine. Usually I didn't need to make 2 different versions
due to there not being any advantage to doing so. On a few occassions
I could have made 2 or 3 different versions optimized for different
processors but it wasn't important enough to bother.
OOPS I just figured out another optimization to save 4 cycles in the main
loop. I replaced btst #1,d1 (10 cycles) with btst d7,d1 (6 cycles)
Combined with earlier speedups,
during a noisy sound sample this allows me to save an average of 57.56
cycles per decompressed byte. (save 66 cycles 93.2% of the time, waste
58 cycles 6.8% of the time) This optimization also saved another 6 bytes
in the main loop
FINAL STANDING
The main loop takes an average of 154.432 cycles during a noisy part
of a sound sample.
So on my standard 22,000 samples per second sounds it will take
3,397,504 cycles per second on an M68000. That is 47.46% of all available
CPU power just to decompress the audio stream!
* ADPCM3_Routine: Ok I rewrote this routine several times and kept speeding
it up. Eventually I got to a point where I can do something radical that
the Motorola book says will be faster on 000 - 040 but I didn't trust it
so I wrote the routine 2 different ways and was then going to race them.
I copy & pasted the timing code from Chaos into the adpcm routine but
all it did was give me total GARBAGE results that had nothing to do with
anything. That timer() routine is just useless. 8(
ALL ADPCM routines still need more work and are on hold until I can time
the various methods.
**************************************************************************
******* END of ADPCM Asm Routines Upgrade for now *******
**************************************************************************
January 6th, 1999: I've now been working on Chaos for 2 years.
A lot was accomplished this year but not nearly enough for my tastes.
Due to the demands of trying to design the world's best strategy game and
work a day job I just didn't get enough done. I'm very dissatisified that
I still haven't got the music and digital sound effects upgrade installed,
even though this is actually the very first thing I wanted to do 2 years ago.
STATUS REPORT:
There are 132 creatures in the game.
There are 128 Magic spells
There are 37 inanimate objects
There are 7 growths
There are 304 items total.
The main program for v2.3d is 366536
chaos.dat is 66368
Archive size is 500k.
* PRIVATE functions instead of static. Using the word "static" to mean
"private" just doesn't make sense to me. So JC now supports the use
of the keyword PRIVATE for making a function private to a particular
file.
* Put in a Vblank_Counter variable into animatorasm that gets incremented
once each vblank so I have a reliable method of timing things. Obviously
there will be tremendous roundoff error on timing small things but it will
be ok for long operations.
* NEW Asm routines: TestPixel4_320, TestPixel1_320, TestPixel4_640 and
Test_Pixel1_640. We no longer use the old TestPixel4 and TestPixel1
routines. We now use these new faster routines. Since we only use
rastports of 640 or 320 pixels width I made these routines take advantage
of that fact. These new routines are 58 cycles faster on 68000.
The old routines are still available in case we ever need to use them on
a strangely shaped bitmap/rastport.
* New global variables LoResBitPlane and HiResBitPlane. These are pointers
to the first byte of the first bitplane of the LoRes/HiRes screens.
This is a pointer to the actual data, NOT a bitmap structure.
These pointers are required for the new TestPixel routines because the
new routines don't take a pointer to a rastport struct as a parameter,
instead they take a pointer to the first byte of actual data of the
first bitplane.
Timing Results for 1 million calls on 25Mhz 68030
Times measured in Frames. (There are 50 frames per second)
OS ReadPixel TestPixel4_320 TestPixel1_320
Frames 2970 398 291
Calls/frame 336.7 2512.6 3436.4
Speed Increase 1x 7.46x 10.2x
Timing Results for 1 million calls on 7.15909 Mhz 68000
Tested on A2000 with 1 meg chip + 8 megs fast ram.
126 frames to do nothing; this is subtracted from the results.
OS ReadPixel TestPixel4_320 TestPixel1_320
Frames 8272 2070 1577
Calls/frame 120.9 483.1 634.1
Speed Increase 1x 4x 5.25x
ADPCM process/task will
1. Use right channel. So that the left channel of algorythmic audio can
play simultaneously if needed.
2. CTRL-C means to Cancel (abort) playback of the audio. The adpcm task
aborts its current playback (if any) and then waits for more commands.
3. CTRL-D means DIE. Kill the task at the end of the game.
4. CTRL-E to start play back. Set up some variables then send the
Chaos_ADPCM_Task a ctrl-e and it will start playing the specified file.
5. If the Chaos_ADPCM_Task should ever stop playing for any reason then
it will send the main task a CTRL-F (F=Finished).
It doesn't matter _why_ it stopped playing. If it stops playing for any
reason it signals that it is finished with CTRL-F.
So if the sound sample has completed playback, or it couldn't get the
audio channel allocated or it couldn't find the file or the file had a
read/write error or the task was told to stop with CTRL-C, then it signals
a CTRL-F back to the main task right before it begins waiting for the
next command.
68030 timings Using supermegainline version of ADPCM3 decrunch
Main loop is much larger than 256 bytes.
17956 ADPCM_000.lib JC
Filesize Filename Frames
19585 LetsPlayChaos.adpcm3 15
13060 LetsPlayChaos.adpcm2 8
195100 ChaosRules.adpcm3 157
130070 ChaosRules.adpcm2 78
17484 ADPCM_020.lib with a routine that fits into the 256 byte cache
19585 LetsPlayChaos.adpcm3 13
195100 ChaosRules.adpcm3 128 18.5% faster
So even though the megainlined version saves 2 instructions (bsr/rts) for
each byte decompressed, we still lose speed overall because the main loop
becomes so big that it won't fit into the cache of the 020/030.
According to the timing charts the megainlined version should have been
faster on all CPUs.
* I made 2 versions. 1 optiminzed for 000 and one optimized for 020.
ADPCM_000.lib and ADPCM_020.lib
* NOTE about OS compatibility: If the game were ever to require OS 2.04
or higher (which I assume it will when we make the game internet-capable)
then we can replace all occurences of CreatePort with CreateMsgPort
and all occurrences of DeletePort with DeleteMsgPort and all occurrences
of CreateExtIO with CreateIORequest and all occurrences of DeleteExtIO
with DeleteIORequest then we could stop linking with amiga.lib and
hopefully save some bytes on the executable filesize.
* MAKEFILE improved with new options: demo_020, release_020 and
releasewithleveleditor_020. These options compile all JC code using
68020 instructions and optimizations and link with the 020 version
of ADPCM lib. This way all low end users will get a version of the game
that makes MAXIMUM use of their limited processing power.
smake demo_020 produces a filesize of 338360
smake demo produces a filesize of 342312
* STRANGE: On December 25th, 1998 the filesize of the demo was 366536.
Since then I've added about 1k of asm code, 500 lines of JC code and
about 18k of lookup tables yet somehow the filesize has SHRUNK by 24k!
The only thing I can figure is I must have forgot to do a smake clean
before doing smake demo on Christmas day, thus I was using unoptimized
code.
ADPCM DECRUNCH ROUTINES
Christian Buchner vs. James Conwell
Using the current versions of the routines on January 16th, 1999
On all timing tests the display mode is the standard Chaos split screen
320x256x5 bitplanes and 640x256x3 bitplanes.
68000 with 8 megs fast and 1 meg chip.
CB JC
Filesize Filename Frames Frames
19585 LetsPlayChaos.adpcm3 152 101 1.5x faster
13060 LetsPlayChaos.adpcm2 134 61 2.2x faster
68030 with 12 megs fast and 2 megs chip.
19585 LetsPlayChaos.adpcm3 17 13
13060 LetsPlayChaos.adpcm2 15 8
195100 ChaosRules.adpcm3 165 128 1.3x faster
130070 ChaosRules.adpcm2 152 76 2x faster exactly
There wasn't enough chipram available to easily test the "Chaos Rules" 500k
sample on my 68000 based amiga so I just skipped it.
* TESTED the adpcm3 playback routine on 26.5 Khz sound samples from a floppy
drive on my 25Mhz 030. WORKS PERFECTLY. No skipping. It plays the samples
back straight off the floppy using double-buffering.
* TESTED the adpcm3 playback routine on 26.5 Khz sound samples from a floppy
drive on my 7Mhz 000. SERIOUS buffer underflow. The routine would need to
be at least twice as fast as it currently is to work on the 7Mhz 68000.
Even if I put in the 24k lookup table + all my other tricks I can't make
it go twice as fast as it already is.
* TESTED the adpcm2 playback routine on 26.5 Khz sound samples from a floppy
drive on my 7Mhz 000. Small amounts of buffer underflow for each buffer.
So that a long sound sample skips a bit here and there or crackles.
Sometimes the head has to seek to the next part of the file and there is a
BIG skip. 8( Hopefully all will be fine once I cut the sampling rate in
half to 11Khz for the floppy disk version. The hard drive version will
still use the 22Khz sounds.
It would really help if the floppy version could use a fast file system
floppy. But, alas, that requires OS 2.04 or higher.
* BUG in my 8svx datatype. I squished my sound samples down to 11k but
now x2adpcm can't convert it due to a silly bug in the 8svx datatype.
So all my sound upgrading is on hold till I get a new internet account
and download the latest version of the 8svx datatype.
* Sent off for a new internet account on January 16th, 1999. It costs
$240.00 for 1 year and has dialups all over the USA and Canada.
* Changed wizard names to names that actually mean something to me.
This makes the game a lot more fun for me.
SETBACK: I can't get the fake seglist code from the RKRM manual to work.
I just get strange problems. So my new Chaos_ADPCM_Process won't work.
I must either wait to get my new internet account to find out what's going
on or I must really load the code off of disk and communicate to it with
messages instead of just signals like I am doing currently.
I own many Amiga programming books but none of them explains how to create
a process using some code that is already in your program. This
information might be in the AmigaDOS Developers book but I don't have that.
Dear SAI: I really hate the bipedal generators in their current form.
So we should do one of the following:
A) Set bipedal generators to generate at the same frequency as standard
generators.
B) Have yet another setup screen that appears when Generators>0
that allows us to turn on/off which types of generators we will
get. A "Generators Setup Screen".
I prefer option A simply because its the least work while making the game
meet my wants. If you don't like option A then we'll have to do option B.
* CHANGED: Bipedal Generators to generate at the same rate as Aviaries.
PROBLEM: The pearl.font isn't being used in the game when I play it
on my OS 1.3 amiga. ??????????????????
Ok, I made some changes. Maybe this is fixed now.
* James opens a can of "WHOOP ASS".
* James guggles down the whole thing.
* James rewrites line of sight testing to be 9x faster than present,
21x faster than it was originally. Boring details follow:
******************* LINE OF SIGHT SPEEDUP UPGRADE *******************
Timing test of line of sight routine on a clear board with a wizard
in each corner pressing the L key. The animator task is stopped but the
color cycler task is running at full speed.
68030 68000
Bottom Left Corner: 26 frames 181
Bottom Right Corner: 28 frames 181
Upper Left Corner: 27 frames 180
Upper Right Corner: 27 frames 180
I massaged the C code a bit to use WORDS instead of ints but this actually
made it 4 frames slower! (?) Put it all back to ints.
C optimization 1.: saved 1 frame on 030.
Every corner now : 25 frames
C lookup table implemented:
68030 68000
Bottom Left Corner: 12 frames 92
Bottom Right Corner: 12 frames 92
Upper Left Corner: 12 frames 90
Upper Right Corner: 12 frames 90
2.25x 2x times faster
C optimization 2.
68030 68000
Bottom Left Corner: 10 frames ??
Bottom Right Corner: 10 frames
Upper Left Corner: 10 frames
Upper Right Corner: 10 frames
2.7x
C optimization 3. (optimized AutoAccept())
68030 68000
Bottom Left Corner: 8 frames ??
Bottom Right Corner: 8 frames
Upper Left Corner: 8 frames
Upper Right Corner: 8 frames
3.37x
C optimization 4. (precalc all AutoAccept())
68030 68000
Bottom Left Corner: 7 frames 68
Bottom Right Corner: 7 frames 68
Upper Left Corner: 7 frames 68
Upper Right Corner: 7 frames 68
3.85x 2.65x times faster
Now I will rewrite the inner loops in optimized assembly language.
68030 68000
Bottom Left Corner: 3 frames 27
Bottom Right Corner: 3 frames 27
Upper Left Corner: 3 frames 27
Upper Right Corner: 3 frames 27
9x 6.66x times faster
Added special optimized code for handling straight lines and 45 degree angles.
68030 68000
Bottom Left Corner: 3 frames 24
Bottom Right Corner: 3 frames 24
Upper Left Corner: 3 frames 24
Upper Right Corner: 3 frames 24
9x 7.5x times faster
C COMPILER BUG: a line like this screws everything up and reports bogus
errors:
ELSE // up to left \
Absorbed isLineOfSightTestQ into isLineOfSightQ
68030 68000
Bottom Left Corner: 3 frames 23
Bottom Right Corner: 3 frames 23
Upper Left Corner: 3 frames 23
Upper Right Corner: 3 frames 23
9x 7.8x times faster
If I was completely psychotic I could save 1 last frame on the 68000
version only.
Just for fun I went back and put in the original line of sight testing
code from v1.7 (this is before I put in those optimizations in 1997)
68030 68000
Bottom Left Corner: 63 frames 392
Bottom Right Corner: 63 frames 392
Upper Left Corner: 64 frames 390
Upper Right Corner: 63 frames 392
21x 17x times faster
******************** END LINE OF SIGHT SPEEDUP UPGRADE *******************
* Made algorythmic sound effects allocate/deallocate the sound channel.
Now that it no longer hogs a sound channel at max priority I can add
ingame music.
Tuesday, Jan. 26th. Melissa and Mike got busted/bluffed by mike's wife
for cheating on her. Lots of crap. No work accomplished.
* CLASSIC: Ogre Mage, Standard Wall, Weak Wall, Rock, Speed and Slow
are now CLASSIC.
* CHANGED: Impurities and Agent Casting can no longer be set using the
ingame menus. I had to do this to pave the way for the internet upgrade.
We can only allow the user to change settings during the game which do
not materially affect gameplay. Things which materially affect gameplay
must be set _once_ at the beginning of the game and then remain unchanged
for the duration of that game. Replaced MENUImpure and MENUAgents with
the global variables "Impurities" and "AgentCasting".
At some point I'll use the empty space for music and sound effects
options.
* Placed Impurities and AgentCasting on setup screen and in savegame file.
This means the savegame format has changed so previously saved games
will no longer load correctly. Tested and verified, I loaded an old
savegame and the whole game locked up but at least the computer didn't crash.
* FLAW: (at least I assume this is a flaw). I had a stone giant stand on
top of a dead stone golem. Each turn the computer players would justice
or dark power my Stone Giant and it would be reinstated as a stone golem.
then the next player would justice my new stone golem and it would go
back to being a Stone Giant. ad infinitum. This is caused by the fact
that justice and dark power leave corpses behind when in previous versions
they did not. Anyway I changed it so that Justice/DarkPower/Exorcise/etc.
do not leave corpses behind anymore. FIXED and TESTED.
* BUG: C for CAST does not work on the second Justice/DarkPower/speed/slow
etc. (any multiplicity spell I guess.) Strangely, the C key works for
Shadow Woods and other trees. Ok, I traced this to a problem in the
spell files where the target of the spell is highlighted with the
highlight sprite. The C key uses the position of the HighLight Sprite
for determination of who the caster is. This information was being
lost. NOW FIXED in every spell file.
It would be really nice if we could position wizards with cut and paste
in the level editor. We could then design multiplayer levels much more
easily. This is something both Joseph and James have been wanting.
Leaving this for SAI.
SAI: The editor now has fragile support for this.
* The turn number is now displayed on the New Game and Quit Game requesters.
I've wasted quite a bit of time the last few weeks due to trying to
maintain OS 1.3 compatability. I've had major problems which are still
not solved with the ADPCM process. I think
that if I was using OS 2.04+ routines that these problems would simply
not exist. Therefore there is a very real possibility that I will
make the game require OS 2.04+ very soon.
* Disrupt no longer kills scrolls + I added the following sentence to the
description: "This spell currently does not affect wizards, growths,
inanimate objects or scrolls."
* various changes to docs.
* Feb 8th, 1999: Downloaded the latest 8svx and sound datatypes.
Downloaded the ZXAM20b.lha emulator from aminet.
* FLAW: At beginning of Spell Selection phase there is still text left over
at the bottom from the movement phase. FIXED.
* LIST PROCESSING implemented for the sentence generation of what wizards
say during their spell selection. There are now around 20x as many things
that they can say without taking 20x the memory. It's extremely easy to
edit the TalkLists file and add new stuff in, you don't even have to
recompile! I took this code from a True Basic paragraph generator that I
made a few years ago. Only I didn't bother to translate all the paragraph
stuff. Just the 1-line sentence generation and list processing stuff.
* WriteNearBottom can now handle 2 lines of text.
* BUG: a computer wizard cast Alliance but then didn't actually cast it on
anyone. Or at least he didn't get any allies by casting it. This has now
happened 10 to 12 times. When playing a game with no generators the
Alliance spell always works. The problem is that the computer wizards
always try to ally themselves with the Independents when independents are
available but the spell is programmed to fail when applied to an Independent
creature. NOW FIXED.
* ADDED New CastInfo bits: CAST_NOINDEPENDENTS and CAST_NOASLEEP so that it
it is illegal to cast Alliance on independent or sleeping creatures.
It is now illegal to cast sleep on sleeping creatures too. This will help
prevent the computer players from doing stupid stuff.
* CHANGED: CAST_UNDEAD to CAST_MUSTBEUNDEAD.
BUG: If you select "quit" from the menu and then click the checkmark then
some enforcer hits are generated. When I run the game under CPR, the game
simply locks up and does not quit. Note to SAI: Does any of this happen
on your system? Note from JC: I fixed this bug months later on October
21st, 1999.
* BROKEN: Aviaries, Dragon Nests and Bipedal Generators never generate
anything anymore 8( (at least not when playing with 8 wizards.)
I just played a test game against 8 wizards and 4 generators and the
generators NEVER generated anything. Ok, this is because I had
AgentCasting turned off. I have NOW FIXED this so that even with
AgentCasting off, the generator agents still generate.
* MAJOR BUG: A computer wizard just attacked his own elephant! This might
be because he was beside it and was "engaged" to it or perhaps he tried to
mount it? Lucky for him his elephant didn't attack him back, it charged
toward the nearest enemy instead. The bug was in ChooseDestination().
NOW FIXED.
* BUG: Computer Wizards keep trying to mount meditations which are already
occupied. NOW FIXED.
* BUG: A computer Wizard just cast Animate on turn 1 and then nothing
happened. It didn't say what he cast it on. It didn't say he aborted it.
OK, he didn't have any inanimate objects so "nothing" is exactly what was
supposed to happen. I modified isStupidCast to check for this but
I have NO idea if my player number is correct or off by one.
NEVER MIND: I have eliminated the "player" parameter from isStupidCast.
It now gets its player information directly from CasterCell, thus permanently
and forever solving the off by 1 player number problem for this routine.
NOW FIXED.
* BUG: Computer wizards routinely waste Subversion type spells on creatures
which are being ridden. I don't know why FLAG_NOWIZARDCELL doesn't prevent
this from happening. Sleep spells are wasted this way too. Leaving for SAI.
SAI: Well I looked at the code for this and I can't see anything wrong
with it. But I think I have seen this happen as well. I'll investigate.
SAI: Found and nailed the bug. NOW FIXED. Details appear later.
HandeIDCMP changes:
* I took out that ActivateWindow() call because it was annoying me by
transfering my input to chaos when I am in the middle of using another
program, such as web browsing or CED etc.
* Added an ActivateWindow() call to activate the main window whenever
you click in the Hires window.
END HandleIDCMP changes
* FLAW: Dark Wood, Speed and Slow spell descriptions do not show how many
attempts of each you get. FIXED.
* ADDED: DO_THIS to JC.h and JCformat.c. Its just like DO_FOREVER. For
some reason every time I see DO_FOREVER my brain expects the whole loop to
execute forever even though there could be an exit condition in the
LOOP_WHILE or LOOP_UNTIL. So I just made a DO_THIS.
* All spells which start with the letters "a"-"g" have been upgraded to JC.
* BUG: The "Destroy Wall" spell destroys walls but does not reveal what the
wall was covering. If the wall was covering a scroll or artifact or corpse
or etc. then it is destroyed. FIXED by changing
InsertCreature(cell,NOTHING,NOTHING) into RestoreCell(cell)
I can't think of any time that we should be inserting a NOTHING into a
cell. If we want to get rid of an object then we must use RestoreCell(cell)
so that any covered objects are revealed. If we want to insert a creature
then we should just InsertCreature(cell,CreatureID,Player)
If you really want to wipe out an entire cell then just call:
void ClearCell(int cell)
FUNCTION
ObtainSemaphore (&BoardLock);
ClearVisible(cell);
ClearUnder(cell);
ReDrawCell(cell);
ReleaseSemaphore(&BoardLock);
END_FUNCTION
* BUGS: Boil, Quench and Still all have the same bug as Destroy Wall.
ALL NOW FIXED.
* ALL occurrences of InsertCreature(cell,NOTHING,NOTHING) removed from
every where! Most were replaced with
ClearUnder(cell), ClearVisible(cell), RedrawCell(cell)
Now I went back and replaced those code sequences with ClearCell(cell)
* FLAW: RestoreCell(cell) does not call RedrawCell(cell) like other core
routines do. Since RestoreCell will often change what needs to be drawn
there I made it do it automatically. FIXED.
* BUG: I played a game with 99 hidden scrolls and 99 hidden artifacts and 2
wizards and the the initial "Repulsion" messed up the color pallette of the
game. There was a place where the code did a return without reloading
the original colour pallette. FIXED.
* BUG: Animate destroys any item which is under the item being morphed.
Corpses, artifacts, scrolls, etc are being destroyed this way. FIXED.
* BUGS: Alter Reality, MassMorph and Mutate have the same bug as Animate.
ALL FIXED NOW.
* Nuke destroys the entire cell and I left it that way.
* CHECKED over every occurrence of InsertCreature in every spell file and
everything looks good.
Question for SAI: I was working on IntelligentMagicWoodCasting and I just
always assumed that if a wizard was warped off the board then GetWizardCell(p)
would return -1. But that is not the case. GetWizardCell() has no special
code to handle warped wizards. Is GetWizardCell going to tell me the
last position of the wizard when he was on the board? ??
Should any of this be changed?
SAI: This indeed sounds bad. NOW ALLEGEDLY FIXED
* NEW stuff to be used with my upcoming IntelligentMagicWoodCast(CasterCell)
* NEW functions sqDistanceFromNearestTeamWizard (CasterCell,cell) and
sqDistanceFromNearestEnemyWizard(CasterCell,cell) which
return the sqDistance from cell to the nearest (team/enemy) wizard.
Team info is extracted from CasterCell. CasterCell is only used to
determine which team is being dealt with.
* NEW predicates: isTree, IsTree and isIDTree.
*** Playtesting ***
Playtested 1 game, here is what I found. I controlled 1 wizard against
7 enemy wizards. Nobody was in an alliance. No scrolls, no artifacts.
99 spells. 0 turns. Texas Trash'em. 4 generators.
* BUG: I was player 2. Player 8 killed player 3 and somehow all the foes
vanquished from the player 3 wizard got put onto my wizard. NOW FIXED
(see far below)
* BUG: Player 6 just killed my orc with his wizard but it put the orc on
_my_ wizard's Foes Vanquished. NOW FIXED (see far below)
* BUG: uhmmm every wizard that I can see has the exact same Foes Vanquished
list. NOW FIXED (see far below)
I Won the game in 22 turns (This is not a bug :)
* BUG: After winning it showed the score window and the window title sort of
says "Player scores for turn 22" but the first 4 bytes of "Player" are all
messed up. Ok, this is happening anytime I click in the HiResWindow. I
don't know why the title gets trashed, it might be a symptom of a serious
problem but I have simply worked around it by changing the Wait().
Technically the bug is still there, you just don't notice it so much
since the window immediately gets closed and reopened.
started a new game identical to the last one:
* BUG: Wizards 2,3,4 say "Foes Vanquished 0" on their info screen.
Wizards 1,5,6,7,8 have a big blank spot instead. NOW FIXED (see far below)
Ok, now I completely quit the game, then did "run chaos" from shell.
Now all the wizards say "Foes Vanquished 0" like they are supposed to.
*** END Playtesting ***
* Fixed Eye for an Eye, Torment, Nuke, Free, Alter Reality spell descriptions.
* CHANGED:
isWizard to isExposedWizard
IsWizard to IsExposedWizard
FLAG_NOWIZARD to FLAG_NOEXPOSEDWIZARD
to make the code more understandable.
* Scroll Delay now defaults to 0.
** Playtest game **
* BUG: My ally cast Magic Shield on my Basalt Golem yet its Magic Resistance is
still 0. This happened after most of the other wizards had been killed
off. ??? I just cast Magic Shield on myself on turn 1 of a new game and it
had no effect! The recovery code was messed up. NOW FIXED.
* BUG: Brain Boost doesn't work either! The recovery code was messed up.
NOW FIXED.
* BUG: an organge jelly just grew over my Nightmare (my nightmare is not
being ridden) and the orange jelly just pirated his Foes Vanquished. The
entire list of Foes Vanquished for the Nightmare is now on the Orange
Jelly. NOW FIXED. see below.
* BUG: I uncovered the nightmare and it has no Foes Vanquished. It doesn't
even say "Foes Vanquished 0". Its all one big blank spot. NOW FIXED.
see below.
* REWROTE: the whole foes vanquished handling so that a creature can be
covered then uncovered and still retain his foes vanquished
list without it being displayed on the growth in the meantime.
The new way seems more logical to me and it allowed the Killed() function
to be much shorter and simpler. Now the van_count and FoesVanquished and
oldvan_count and oldFoesVanquished are all built right into the cell
structure. And the Wizard structure now has van_count and FoesVanquished
array also. NOW FIXED.
* I intentionally fixed the above two bugs and 1 part of the reason I
rewrote the foes vanquished handling was because I was hoping that in the
process of doing so all the other foes vanquished bugs would mysteriously
disappear. Well, guess what? That is exactly what happened. All the
other foes vanquished bugs just mysteriously disappeared. ALL FIXED NOW.
* Modified io.c to properly load and save the information. This means the
gamesave format has changed.
By turn 23 it was down to just me and 1 allied computer wizard.
* BUG: _Any_ time _any_ wizard kills _anything_, the kill shows up on ALL
wizard's "Foes Vanquished". NOW FIXED. see above.
BUG: at some point the audio started sounding strange.. blah blah blah.
I quit the game normally. Later on I recompiled and when it was supposed
to say "compilation complete" the whole computer crashed and reset (no guru)
and the hard drive nearly got trashed. It is "validating" now (has been
for several minutes). No actual data was lost due to the fact I'm using a
real computer and not a pentium. Be on the lookout for some sort of audio
device using/opening/closing bug. I think maybe an audio channel doesn't
get closed sometimes. See below.
* BUG: When computer wizard 1 is on the top of the screen and he is trying to
mount his steed yet is engaged, this triggers enforcer hits. Enforcer
hits do a DisplayBeep() which is what messes up the sound I think. I
know that enforcer hits make the sound effects sound funny. I think this
is because it changes the setting of the audio filter.
(Enforcer Hits problem was in EngageChoice) NOW FIXED!
* STUPID: A computer wizard cast demonic touch on a sleeping dragon (which
was the only enemy creature that he could cast it on). FIXED.
* STUPID: Actually, after looking at the code I could see that ANY spell
might potentially be cast on sleeping creatures. I changed it so that
casting any spell on a sleeping creature is considered stupid except for
Wake. FIXED.
* BUG: A wizard cast Alter Reality on a pegasus being ridden by another
wizard and the spell failed. I have changed Alter Reality so that it can
be cast on creatures which are being ridden by the wizard. I tested this
and it really works! FIXED.
* BUG: Sometimes wizards try to cast Kill on a creature which is being
ridden. The assistance says FLAG_NOEXPOSEDWIZARD yet the spell is
programmed to fail if there is a wizard anywhere in the cell.
I changed this so that the spell now matches its computer assistance
flags. This means it now succeeds against mounted creatures. FIXED.
* FLAW: You can't easily tell when a Subversion/Betrayal/Abduction works or
not. It now prints "Spell Succeeds!" at the bottom of the screen
when it succeeds. (It already said "Spell fails" when it fails.) NOW FIXED.
** END playtest game **
* REMOVED SoundStat from the CreatureInfo structure for the following
reasons.
1. It doesn't belong there. This stat will be set dynamically and will
be different on different people's amigas. It shoudn't even be saved
in the savegame file. It ABSOLUTELY should not be saved in the
savegame file. Well, ok I guess we could save it so long as we
regenerate the stat each time we load the game.
2. It was a UBYTE which isn't big enough anyway.
3. It was stuck in the wrong place for some unknown reason so by
eliminating it we actually save 4 bytes instead of only 1. (it was
totally messing up the alignment.)
4. I am going to implement SoundStat as its own array when I start adding
the digital sound effects to the game.
* INTELLIGENT MAGIC WOOD CASTING implemented: Works great!
Wizards now cast Magic Woods close to themselves and their allies while
keeping them as far away as possible from their enemies.
However any wizard who has " mad", "mad ", "kalsu", "crazy", "krazy" or
"insane" in his name will use the random treecasting routine instead.
This feature is dedicated to Joseph Dixon who said the old way of
casting trees made the game look stupid 8)
Feb. 22, 1999 Mike the freak tried to start a fight with me.
Nothing accomplished Feb. 23-24.
* BUG: Team Scores are wrong when several people are on each team.
Team Life is wrong when several people on each team.
The score and life of the lowest numbered team is being displayed for
their team and their score and life are being displayed for the OTHER
team. NOW FIXED. + the code is a bit more simplified.
* NEW FUNCTIION: AdjacentEnemies(source,cell) to return the number of
enemies of source which are adjacent to cell. Needed for below:
* INTELLIGENT DarkWood and ShadowWood Casting Implemented.
Basically the computer wizards try to cast these trees adjacent to lots
of enemies which are nearby. A small consideration is given to
enemy generators.
* NEW FUNCTIONS to support IntelligentCreatureCast
int isWizardInDangerOfDying(int cell);
int TotalCombatOfAllAdjacentEnemies(int source,int cell);
int TotalRangedCombatOfAllAdjacentEnemies(int source,int cell);
int SmallestAdjacentEnemyLifeToCombatRatio(int source,int cell);
* AVOIDED passing player numbers as parameters to all new functions. This
is to facilitate the elimination of all old wizards[] references by
upgrading to Wizards[] and to help me get rid of all those p+1, p-1
constructs.
* PROBLEM: Every time I am about to win the game I have a bunch of
creatures closing in on the last enemy wizard. It is now a bit harder to
kill wizards since they are sometimes surrounded by trees which block
many of my possible paths of attack and shooting. But every time as I am
closing in the computer wizard will cast a creature to stop me but he
always casts it in the wrong place (like BEHIND him instead of in FRONT of
him). This always makes me feel sorry for the poor stupid computer
wizards. If only he would have cast his dragon IN FRONT of his wizard
(between his wizard and my dragon) he could have lived for at least 1 more
turn. The solution is the following:
* INTELLIGENT CREATURE CASTING Implemented. Works great.
* WOW: I just played a test game and here is what happened on turn 1:
A computer player intelligently surrounded himself with MagicWoodTrees
The excess trees were placed down and to the right which was very smart
because nobody was anywhere near the bottom right corner.
Then, the next computer player cast a Thundermare. But instead of
casting it next to himself he cast it 3 squares away next to the guy who
just cast those magic trees. The ThunderMare is now adjacent to the enemy
wizard and 2 of his Magic Trees! He's ruthless! And he did this EVEN
though there was another wizard who was closer! (but had no magic trees
or other creatures.)
Another computer wizard cast a nightmare and instead of casting it
randomly he cast it adjacent to an enemy wizard who is now engaged to an
undead creature!
The above 2 engaged wizards were the first to die, thus proving that the
other wizards, did, in fact, cast intelligently.
Couple of turns later: Some computer guy just cast a Bolter Wall directly
between my wizard and my Eagle! He completely messed up my whole plan!
Instead of just throwing it out on the board he put it where it would
cause me a lot of problems.
* BUG: in new IntelligentCreatureCast: Casting a creature while in someone
else's tree makes the creature become the tree owner's instead of the
caster's. FIXED.
* All spells which start with "h"-"p" have been upgraded to JC.
* PROBLEM: I have killed wizards many times on the first turn with Ball
Lightning and many other times during the game also. In fact, lately
I've been winning the game in only 12-18 turns. So I have now
* REDUCED Ball Lightning's Life damage from a 10:1 ratio down to 2:1.
BUG: My wizard with 21 life just cast sanctuary and it only gave him
2 recovery!!! I am unable to duplicate this bug. Perhaps someone
whacked him with a poison dagger when I wasn't looking. I don't know.
* BUG: The spellmanager just crashed my computer while processing the
spell file for MassMorph. I mistyped Commment: instead of Comment:
FIXED by SAI.
* All spells which start with "q"-"z" have been upgraded to JC.
* CHANGED: Abath combat from 4 to 8 since the description says that it
has an enlarged horn which can induce severe bruising.
* BUG: smake newspell does not rebuild pool.ssc. Thus when I change a
spell description and do smake newspell, the new description is included in
spells.tex and spells.html but not in the game itself.
smake clean smake dev does not rebuild pool.ssc either. As near as I can
tell only smake release rebuilds pool.ssc. Leaving this for SAI.
SAI: Allegedly fixed this by making smake newspell first delete pool.ssc
so that the system will have no option but to remake it.
SAI: Well that didn't work, so now I deleted pool.txt as well.
SAI: That didn't work either, ISWYM about this problem. I think the real
difficult is that Amiga makefiles don't allow two dependencies on the left.
SAI: Oh, no wonder it isn't working there is nothing in the makefile that
causes the pool.ssc line to be invoked. Therefore I've added pool.ssc
to the top line of requirements in makechaos.
SAI: No that didn't work either. Oh, well I continued fixing this
below.
SAI: Gave up on the old makefile and rewrote it.
*************************************************************
***** MAD RAMPAGE to eliminate all wizards[] references *****
*************************************************************
* REPLACED all 3 of the remaining wizards[] references with Wizards[] in
predicate.c. Rewrote various FOR NEXT loops to facilitate this.
* REPLACED both of the remaining wizards[] references with Wizards[] in
chaos.c.
* REPLACED all 5 of the remaining wizards[] references with Wizards[] in
bonus.c. Rewrote ChooseGUISpell() to require a REAL player number instead
of a fake one.
* REPLACED all of the remaining wizards[] references with Wizards[] in
spell.c.
* REPLACED all 10 of the remaining wizards[] references with Wizards[] in
cast.c Rewrote DoComputerCast() and PlasmaBeamHandler to require a REAL
player number.
After doing all the above I played some test games and found that I had
accidentally created 2 bugs. These were easily fixed but it shows that
extreme caution is warranted.
* All wizards[] references have now been successfully eliminated from
everywhere except the spell files.
Create a new variable "Player" for Cast, CastFree and CastMagic.
This variable will replace "player" and "p" slowly but surely.
player and p are the old fake player numbers.
Player is the REAL player number.
So it is simply a matter of replacing all wizards[p] or wizards[player]
with Wizards[Player]
Eventually "player" and "p" will be obsoleted and removed.
Any function calls of the form Function(player) will be replaced with
Function(Player-1). Eventually all functions will be rewritten to use REAL
player numbers so that the -1 can be removed.
Any function calls of the form Function(player+1) will be replaced with
Function(Player)
Replace wizards[player].xyz with wizardsp->xyz (which = Wizards[Player])
Before attempting this, the main filesize of a smake release is 358544
* All old wizards[] references have been REMOVED from ALL Spell files!
YAY!!
* REWROTE: Drainer(), WakeUp(), HandleJoker(), ScoreAdd(),GetWizardCell(),
CastFreeSpell(), CastMagicSpell(), Multiplicity(),
to use REAL player numbers instead of fake ones.
This allowed me to eliminate ZILLIONS of "Player-1" style references.
* Removed "player","p" and "i" from cast.c functions.
* REWROTE the FOR-NEXT loops so that the "currentPlayer" global variable is
now the REAL player number instead of the realnumber-1.
* REWROTE InformationPanel(), InformationPanel1(), SayName(), AddSpell(),
AddGUISpell(), GetSpells(), WhatSpell(), QuerySpell(), SetSpell(),
ComputerSpellDiscard(), IntelligentComputerSpellSelect(),
to use REAL player numbers instead of fake ones.
* ALL the functions in cast.c, predicate.c, predicate.h, info.c, chaos.c,
spell.c which take a player parameter now take a REAL player parameter.
ALL the functions in move.c and cmove.c already took REAL player numbers.
* Several functions in spell.c which take a real player number parameter
still use fake player numbers internally to index into various arrays.
I'll fix that later.
* Main filesize of smake release is now 357308. Only saved 1236 bytes.
**************************************************************
***** END MAD RAMPAGE ****************************************
**************************************************************
* STUPID: A computer wizard cast reincarnate on his ally's Bolter Wall
which already had Reincarnate cast on it. FIXED.
* STUPID: A computer wizard cast Horror on a creature which already had
Horror. FIXED.
* POSSIBLE BUG: A computer wizard just cast "Free" on a manticore that was
being ridden by another wizard. The Manticore is now an independent and is
still being ridden.
SAI: Yep, this is a bug, the spell file need to check for this.
SAI: NOW FIXED.
* BUG: Click on an eyeball. Now try to attack an undead creature by
accident. Now it says you are engaged even though there are NO creatures
next to you. You can't move or do anything but cancel your movement.
This was found when I tried to attack a Wizard that had Liched himself.
Leaving this for SAI. FIXED by SAI. Details appear later.
************************************************************************
******* An Enforcer Hit Bug Related to a Vanished Computer Wizard *****
************************************************************************
BUG: I vanished an enemy wizard and then at some point thereafter (perhaps
in the movement phase) numerous enforcer hits occurred. Unfortunately I
forgot to run the game under CPR so I don't know what caused this exactly.
I saved the game at this point.
BUG: the thinking phase of the vanished wizard triggered more enforcer
hits.
I played the game for several more turns until I won.
Now I quit the game and did a run cpr chaos
oh great, when I try to load the saved game it doesn't work! 8(
I'm figuring that this is all related to bogus returns by GetWizardCell
when a wizard has been vanished.
Ok, I just spent half an hour looking around at files, trying to decide
what I'm going to do tomorrow. I'm tired now. I'm going to bed.
STRANGE: I woke up the next morning and whaddaya know? The game from last
night is sitting there in cpr with a BUS/ENFORCER HIT in IsExposedWizard.
(I leave my amiga on almost all the time.)
So the game loaded correctly after all! YAY! I have no idea what caused
the huge delay.
This is all caused by the first few lines of IntelligentComputerSpellSelect
which derives the cell of the wizard, which for a Vanished wizard is all
completely bogus. Leaving this for SAI.
SAI: I will attempt to replicate this problem if I have time. Problems like
this used to occur when warped wizards mistakenly tried to cast spells.
The only likely reason is that something has corrupted the warped bit of
the corresponding wizard entry.
SAI: Vanished objects should never try to select a spell in the first place.
However, the code in IntelligentComputerSpellSelect will indeed fail if it
is called erroneously like this, because their will be a dereference of the
type board[-1].
JC: Ok I fully understand this problem now. Vanished wizards should never
be thinking about casting a spell because their .Warped bit will be set.
So if I ever encounter this bug again I'll know what to look for and can
hopefully fix it.
***************************************************************************
***** End of An Enforcer Hit Bug Related to a Vanished Computer Wizard ****
***************************************************************************
* IMPROVED the speech of "Player One", "Player Two" etc.
* STUPID: A wizard just cast combat on himself and on the next turn he cast
Poison Dagger on himself, thus wasting his combat spell! FIXED by raising
the ranking of Poison Dagger by 4 points to be 1 point higher than Combat +
modified IsStupidCast().
HYBSIL says it fires poisoned arrows. So we should either:
A) Make its Ranged Combat attack recovery or
B) Change the description to say "more powerful arrows" or "deadlier
arrows" or "stronger arrows" or something of that nature.
Which do you want to do?
SAI: Implemented option A. NOW FIXED.
* CHANGED: WoodElf only needs 4 kills to be promoted to a DreadElf.
ReleaseSemaphore(&SourceCode); by JC on March 10th, 1999.
ObtainSemaphore(&SourceCode); by SAI on 990312
* Siphoned off 1998 readme stuff into a separate file: readme.1998.
* Expanded the list of names available at the start of the game. See the
file namer.c for details. Basically names at the start of the game
are randomly assigned from a possible list. It would be easy to make
this a configuration file like "TalkLines" but I have refrained from
doing so because I don't want a massive proliferation of such files.
Players can of course still edit the names at run time.
JC: Hmmmm... I hadn't ever really thought of the TalkLists file as a
"configuration file" that end users would manipulate. I just made it the
way it is to be easy for me to update it. But now that you have mentioned
it -- it really is a user configurable file like spell.prb
QUESTION: Should players be able to edit names?
JC: YES! Absolutely. When I play games against other humans we _always_
edit our names. We even edit the names of the computer wizards to have
their player number after their name.
We could save memory
(by dropping all the gadgets associated with such editing) but
disallowing it. In general I am keen on options like that, but if
very few people use it perhaps it is not worth it. I for one hardly
ever alter my name. ??
PROPOSAL: Amalgamate various configuration files into a single file
TalkLines
chaos.prb
classic.prb
WizardNames (not yet existing)
Default preferences (not yet existing)
I suspect it would take about 2K to implement a full parser for such
a file. (However, these files all have separate parsing at the moment
anyway--so perhaps it would reduce memory usage--it would also
certainly improve startup speed).
JC: I like having seperate files for seperate things. Its nice and logical
that way.
JC POSSIBLE COUNTER PROPOSAL: Simply put all user-configurable files in their
own directory. Config/ Then if a user wants to configure something there
will be some files there each clearly named as to its purpose.
Of course it is entirely possible to play the game for years and never
need or want to edit the probability files. I've only done it once
myself. My real life friends who play the game have _never_ edited the
probability files.
The problem with this idea is that a config directory is more noticeable
and people will be more likely to go in and change things around.
Whereas now, most people don't even think about it and they leave
everything the way it is.
JC: Bottom Line: I'm perfectly happy with things the way they are. People
don't really need to know that TalkLists.txt is editable by them. If
they figure out they can add their own stuff in then let them. It'll be
there for the power users.
PROPOSAL: Drop the menu section of creatures from the editor (the
pull down menus that is, not the graphical method!) This menu
system is really rather redundant given the graphical method and
is harder to maintain automatically when new spells are added.
Finally it has no support at all for non creature spells.
JC: I concur 100%
PROPOSAL: Given that we are tentatively going outside the std A500,
I recommend using #ifdef BIG to surround code to appear only in the
advanced version. This would be preferrable to having to maintain the
old version separately. I can see there are still a few potential
problems, in particular with dealing with the spell files via
Spell Manager etc. I will have to add a new tag similar to Classic
indicating whether a given spell should only be present in the BIG
version of the game.
JC: If you want to try this you can, but it will be entirely your
responsibility 8). Once I finish the 1 meg version I intend to never
look back. All the current gaming consoles like PlayStation have at
least 2 megs of ram. The newest game console, the Sega Dreamcast has
26 MEGS of ram! Most of the people I know who still use A500s have at
least 5 megs of ram on their system. But the real kicker is that once
I implement the graphics upgrade I don't think you can possibly do any
#ifdefs to make it run. The graphics are simply going to take more
than 1 meg, in fact they will quickly be approaching the 2 meg limit.
HINT TO ALL 1 MEG AMIGA OWNERS: For god's sake, buy some more memory!
* Removed traces of TeX from defines.h
* Completely went through spell.c making modifications to
A: Eliminate spell selection gadgets.
B: Make it so we use standard player numbers.
C: Remove TeX/fix comments
D: To do a general audit on the code.
* Okay I finished all the changes for Phase 1 of the spell selection
upgrade and went to move them to my Amiga via a PC disk. Immediately
I had a problem. DOS as usual truncated my Linux/AmigaDOS files names
to 8 letters so that MakeDemoOfChaos became MakeDe~1. Now I knew this
would happen and my Amiga had no problem copying them off the PC disk
onto my harddrive. But then the problems began. The brain dead AmigaDOS
rename command just would not rename the files to something sensible.
I tried all sorts of ways of doing it. Copy didn't work either, it
just insisted on making a new directory every time. In the end I had
to delete them (at least it let me do that) and copy them again from
Linux with shorter names. Another 10 minutes wasted. OK, DOS is real
lame for having such a stupid filename limitation, but AmigaDOS is
just as daft for letting you create files that you can't rename or
copy! I never have these problems with Linux. Well if my Amiga wasn't
so old and slow then I suppose I would be more keen to use it.
JC: the ~ symbol is used by AmigaDOS to mean "not" in pattern matching.
so that you can things like:
LIST ~(#?.txt) to list all files that do not end in .txt.
| is used to mean "or" btw. Anyway, I guess this causes a bug in the
copy and rename commands when dealing with files with ~ in them. 8(
Hint to SAI: Buy a faster Amiga! 8) I have a lot of Amiga friends on the
net with 50 Mhz 060s. That's about 10x faster than our 25Mhz 030s.
And I haven't even mentioned the ones with 200Mhz PPC Amigas.
* Anyway back to the important stuff. The SpellTable now works with
real player numbers. There are new functions in spell.c to deal with
displaying spells for selection using simple mouse events rather than
gadgets. HandleIDCMP in chaos.c has been modified accordingly.
POTENTIAL BUG: Looking at HandleIDCMP I don't see what is stopping the
program from doing an InformationPanel request on invalid information
when the player clicks outside of the normal board. I will test this
as soon as I can get the game to compile again. NO, I JUST OVERLOOKED
ONE IF STATEMENT. The call is safe. NOT A BUG. IGNORE THIS PARAGRAPH
* As a result of my changes the file "gadget.c" is now obsolete and
has been deleted.
* Well it seems some of my changes don't want to compile. So I think it
is time I go to bed and sort out the problem when I am fresh in the
morning. In particular my clever &HST[-1] assignment failed because
it can be done at compile time, although I don't understand why
given that both objects are static. Anyway I'm sure I will be able
to fix that in the morning.
SATURDAY 990313
* I got my changes to compile now. My new names didn't work at all, the wizards
just showed up without names. The spells were not quite drawn at the
correct position and worse the same spell was repeated for the entire
screen. Finally the spell selection didn't work at all.
Okay it is now displaying the spells okay but the selection is not working.
Damn, I've just been called into work when I thought I would have the whole
day for Chaos. At least I managed to put them off until the afternoon. I
should have used my modem so they couldn't call me! Now my Amiga appears to
have locked up during compilation (I'm writing this on my Linux box). I'll
give it a couple more minutes. REBOOT. Okay compilation successful again.
* Phase 1 of the spell selection upgrade is now completed. The spell gadgets
are gone.
* I've run into trouble trying to manipulate the HST[][MAX_SPELLS] structure.
I can't get the compiler to give me a pointer one entry logically earlier
than memory than the first. I want HST[-1]. Normally this sort of thing
works exactly as you would expect, but in this case the compiler just gives
modifiable lvalue complaints, but I don't know how else to declare the
pointer I wish to assign to. The weird thing is that when I use #define
(&HST[-1]) for the same purpose it works without problems. I'm sure that
short *SpellTable[MAX_SPELLS] ought to give me a 4-byte quantity which is a
pointer to a array of MAX_SPELLS short, and maybe it is but the compiler then
will not let me do SpellTable = HST[-1].
Finally got it sussed the relevant line is (from spell.c):
static short (*SpellTable)[MAX_SPELLS] = &HST[-1];
getting the parentheses in there was the key.
* Moved the Dismount gadget up next the query gadget.
* Implemented Phase II of the spell selection upgrade. The spell the mouse is
over is now reported at the bottom of screen. The works harmoniously with
normal cell reporting. The relevant changes are in HandleMOUSEMOVE.
* I decreased the delay for messages to stay on the screen during computer
spell selection. It still seems too long so I will shorten it more yet.
I think it adds to the atmosphere if you have to read quickly, helps
gives the impression of action.
* I've just noticed that computer players no longer use their spells up
(i.e. they are just getting the same spell over and over again). However,
I know why this is happening and it will be easy to fix. NOW FIXED
* Blanked the bottom area of the screen after spell selection.
* Fixed a problem with discarding. Now marks a spell used when it is first
selected so that the player canNOT discard the same spell (this was done
in a completely different way under the gadget scheme).
* Changed printing routines in text.c to const char* to better reflect
their true nature and suppress some compiler warnings (i.e. compiler
will silently promote char * -> const char *, but complain bitterly
going the other way). Didn't do this to WriteNearBottom since it
does not treat its argument as constant.
* Eliminated all warnings in the compilation of chaos.c
* Discovered that it was still printing the last spell list lines at the
bottom of the screen even when they weren't actually displayed on the
right of screen. Modified HandleIDCMP so it no longer does this.
* Modified GetSpellSelection to blank the lower lines after each player
has selected a spell.
* Reduced the delay on the text messages even further. There is now a
constant BASE_DELAY in defines.h which controls this.
* When spell selection occurs now a blank square is drawn over the
selected spell. This helps make things clearer especially when using
the Texas mode.
JC: Cool. Good idea.
* I just discovered that the MagicCastle spell is functioning as a non
spell. Clicking on it is just ignored, it doesn't get used, and you
don't get a chance to use it. This was because MagicCastleID must be
the same as the gadget code for EndID. I modified the way HandleIDCMP
returns the EndID in the case of a spell return to fix the problem. I
was lucky this happened on such a common spell or this problem might
have gone unnoticed for some time. NOW FIXED
* Removed all the no longer necessary references to spellGadgets.
This ends the spell selection upgrade.
WARPING PROBLEMS:
* Hmm. GetWizardCell did seem to have some shortcomings. It now checks
if a wizard is alive and not warped before trying to calculate a cell.
In the case of a dead or warped wizard it returns -1. This will of
course never match a real cell on the board. Previously, a dead wizard
would have been reported at is position of death(?) and a warped wizard
would have returned -(GAMECOL + 1). But this was then cast to an UWORD
so it would have been some big positive number. I'm not sure why this
should have caused problems tho'.
* The three ways things can get warped out are Hide, Vanish, and via a
vortex. All three of these use the WarpOut function and so there should
not be any problem there.
* NEW POWERUP: An orc, goblin, or troll killing an elf, will now pick up the
bow previously used by the elf.
* I just saw the problem where a computer wizard cast sleep on a mounted
creature. There were no other suitable targets nearby, but it still
doesn't explain why that spell was selected in the first place.
NOW FIXED
* Improved the editor so that cutting and pasting a wizard, will cause the
game to correctly register the wizard's position. It will also make the
wizard alive and not warped. I haven't tested this very well yet, put
multiple copies of a wizard at your own risk.
JC: ah... yes I see what you mean. Maybe we should have a different
method for positioning wizards? We just need some way to control the
starting positions of wizards for certain predefined levels.
* I also noted the Docs contain nothing about how to use the editor.
MAKEFILE PROBLEMS: I've been trying to correct the pool.ssc problem for the
last hour now.
* While trying to fix the problem re makefile/pool.ssc, I added a new
creature "Ogre Warrior" to test it.
I've tried several times. I finally got it to automatically recreate
pool.ssc, but it was still incorrect because it did not include the
description for the new spell, thus if threw most of the other spells
off by one position.
This arose because info.c was recompiled before the new index.h file
(dependent on pool.txt) was generated. I've now changed things around
so that "smake newspell" deletes info.o and info.o depends on pool.ssc
which in turn depends on pool.txt. I think this should be sufficient.
* Fixed a bug in image.c that was placing extra carriage returns in output.
* Fixed the editor so that the spell list is redisplayed when the editor
exits.
* Attempted to fix the problem where the bonus spell selection panel is
sometimes made bigger than it should be.
* Fixed a bug pertaining to computer wizard spell selection that was
resulting from my earlier changes to spell selection.
* Discovered that I still haven't succeeding in fixing the make newspell
problem. Now it is not rebuilding chaos.dat correctly!
* Decided that the current system of a lmkfile and makechaos really
sucks, so I rewrote the makefile and it is now just called "Makefile".
(I renamed lmkfile to stinkfile). The new file seems to work much better
but obviously I need to test it a fair bit more yet.
ELIMINATION OF MOUNTED BIT
* Eliminated all occurrences of the MOUNTED bit from the code. Unfortuantely,
I haven't changed all the documentation to reflect this change. Anyway from
now on all testing for wizards should be done with GetWizardCode(cell).
PROMOTIONS UPGRADE
* I added a routine to do sensible promotions on a cell. Several stats now
take the max of the original and the new creature. Not all of them, so there
is still some additional challenges for those deliberately going for power
ups.
* Then I decided that the code in "move.c" for actually testing for powerups
was rather silly, so I rewrote it to use a table rather than a whole pile
of IF statements.
* Then I realized that the table should be generated from the spell files
rather than maintained separately. Therefore, I added tag recognition
for "Promotion" and "ProCount" to the Spell Manager. So now when you want
a creature to get promoted you need only put entries in the corresponding
spell file (see woodelf.spl and ogre.spl for examples). At present the
such powerups can only be specified if they occur once a certain number
of kills have been achieved.
* None of this change does not affects Horse->Thundermare->Iridium or
other powerups that don't just involve bonuses for multiple kills.
* At present the power ups using the new system are:
WoodElf -> DreadElf (4 kills)
Ogre -> Ogre Warrior (5 kills)
Ogre Mage -> Ogre Assassin (7 kills)
Green Dragon -> Emerald Dragon (7 kills)
* Eliminated a warning in the compilation of move.c
SLEEPING/SUBVERSION on WIZARD BUG SOLVED
* I finally tracked down the problem whereby computer wizards having been
casting sleep etc. on mounted wizards when the code looks like it
explicitly rules it out. The problem was that "flags" was declared as a
UBYTE in isStupidCast and DoComputerCast when in should have been
USHORT. I wish the type checking on the compiler was a little more
stringent sometimes. Anyway I believe this change has erradicated the
observed bugs.
* Made the fade twice as fast in Disection spell.
* Changed that Magic Shield spell, so that casting a shield on a creature
with maximum MR causes its MR_Recover rate to increase by one. Hence
by casting lots of shields you can make something *very* magic resistant.
Changed Protection to work the same way.
* Eliminated a warning in the compilation of cast.c
* Fixed the bug in the Free spell.
* CHANGED BoardEffect so that when the effect is for the entire screen
no sound is produced (I found things like "cure" were getting real
annoying because they take several seconds to complete). [Note I am
talking here about the GREENCIRCLEEX effect in cell.c]
META-COMMENT: I've been quite pleased with how much progress I've made in
the little time I've had to work on things. It has been really helpful
having JC's list of bugs with clear things requiring my attention. I note
there are still a fair few bugs on the list to go, so I best get on with it!
* FIXED the bug that was preventing movement after accidently making an
invalid attack. I'm sure this bug must have been introduced as the
result of one of our rationalizations. Anyway it is all fixed now.
* CHANGED: Hybsil when shooting now affect Man and Recover stats making it
more consistent with poison as the description says.
* Made move.c depend on initial_data.c in the Makefile (i.e. depends on
spell information). This is needed because of the promotion.c file which
move.c now includes.
SPELL.C again. I just went over spell.c with my FTC (fine toothed comb) to
try and make it more efficient and save sapce.
* Removed 1 off counters for SpellRank array.
* Removed AddGUISpell as it was the same as AddSpecificSpell
* Made spell.c more likely to compile under Unix (except DrawImage call).
* Fixed potential bugs in board[-1] references
* Replaced various majic numbers with constants.
* Made use of Spells variable more logical.
* If io.c didn't use Spells then Spells could be made static.
* Most places using SpellTable[Player] in a loop have been simplified.
* The order of certain conditionals in computer spell selection has been
changed for speed. Most conditions like if ((a or b) and c) are much
better written if (c and (a or b)) because of short-circuiting eval
of these expression, but great care must be taken in general because
of implicit assumptions about ordering.
* Updated documentation in spell.c
* SpellProbability and DisplayedSpells are now static.
* Some trivial functions are now __inline (perhaps some of the simplest
cases in predicate.c could benefit from this as well).
* MAX_SPELLS has moved from defines.h -> spell.h.
* Fixed a few type anomalies.
* These changes saved 1128 bytes in the developer version.
ENFORCER HIT: There was an inforcer hit on line 27 of text.c corresponding
to a call to Text (probably with an invalid char * pointer). Since this
occurred when I was experimenting with spell.c and it has not repeated I'm
ignoring it. NOW FIXED
MAKEFILE TESTING: I am now make an archive and doing a make from it to
test the new makefile. Okay, I had to make two minor changes, but basically
it worked. I've just noticed that my new makefile does not include options
for making anything other than "developer" version at present. I will do
this simply by including various option lines. Therefore to make a version
you will have to select the correct option lines from the top of the file.
* Improved make clean to delete .h and .c files which are automatically
created.
* Changed the makefile to include options for the 68000 no editor release.
* Changed the makefile to include options for the 68020 release.
* Changed the makefile to incoude options for the demo versions.
NOTED: During compilation of release and demo versions there are many more
compiler warnings about unused variables. I can see two reasons for this:
First some are due to the optimizer (not a lot we can do about those), but
a few are due to #ifdef's not be present around some declarations where
they should be. There are also some warning about possible unitialized use
of variables, these ought to be checked more carefully as they are potential
bugs (if such usage ever actually happened).
IO BROKEN. Discovered that loading and saving is broken as a result of my
changes regarding wizards names. NOW FIXED.
Discovered that my changes to spell.c have caused some anomalies, in one
function I was returning a spell probability rather than a spell! Since
this code was replicated in 3 places in spell.c I implemented a new function
GetSpellFromProbability to make sure they are all homogeneous, now if there
is any problem with silly spells be granted there is only one place where
the code is likely to be wrong. This particular problem was the cause of
the enforcer hit noted above.
I had invertently damaged the Texas option, it now was trying to force you
to discard even when you have no spell left. FIXED.
BUG: I've noticed that when agent casting is turned on they will still
cast bad spells on their team mates when no other targets are available.
COMPLETED: I finished the implementation of the Passage spell. It is no
longer a wizard power-up but a single invocation. The code is rather like
that for PlasmaBeamHandler. This Wizard structure no longer has a "passage"
bit, changed all references to it accordingly. Note this will break io.c
even further, but I intend to fix that problem next. All spells in the game
are now up to date, the only object not yet functioning sensibly is the
"exit". In the mean time it behaves like a normal inanimate, so I'm just
leaving it like that for now.
IO REPAIRS: It turns out the problem with loading and saving games had
nothing to do with my name changes, but that the loading routine was broken
when presented with a name containing whitespace. The culprit has been
modified. Old files should still load (including some that would not before).
However, due to changes in the Wizard tags some wizard powerups will not be
encoded exactly the same, I don't expect this to create any problems,
DELETED Makechaos, stinkfile (was lmkfile), and MakeDemoOfChaos, they are
now all redundant.
CONSISTENCY IMPROVEMENT: When you select sound off from the game menu it now
turns off sound for the independents during both movement and casting. This
makes playing against 99 generators run considerable faster.
PASSAGE: Improved the comment on the Passage spell to reflect that fact
that a mounted creature or mediation can also make passage.
BUG: Wizards were not clearing wizards[].spell after using a spell. This
meant a wizard kept repearing the last spell selected when "coercion" was
in effect. While this was quite neat when it happened, it is not what is
meant to happen with coerced wizards. NOW FIXED.
BUG: Computer wizards (when either exposed or mounted) often choose not to
move. No problem with that. Except sometimes they are adjacent to enemies
cells and they still don't move. In such circumstances it would be logical
to at least make an attack OR an attempt to move away.
DELETED creature selection menus from editor and replaced them with a player
selection menu. Each player also has a hot key RA-1, RA-2, etc. so we have
the best of both worlds.
Did a "smake archive" and rebuild from the archive with no errors. Good.
Fixed another bug perhaps causing problems with warped wizards.
OUT OF TIME. Well I'm off to Australia on Saturday morning, so I am going to
send you the archive now, so I have 1 day to check you received it.
This is the current status:
* I addressed all bugs except those about IDCMP.
* I have still not throughly examined the situation with warped wizards.
* There may be new bugs in spell.c due to the extensive changes I made there.
ReleaseSemaphore(&SourceCode) 8-April-1999 by SAI
ObtainSemaphore (&SourceCode) 8-April-1999 by JC
* BUG: Place the mouse pointer over a cell or spell on the edge of the board.
Now move the mousepointer to off the board and back. The display is now
blank (it doesn't say what you are pointing at). You must first move to
ANOTHER cell and then back. This bug has been around for a long long time
on the board and now it is there in the spell list also. NOW FIXED.
* BUG: I am playing a game as player 2. When I put the mousepointer 1 pixel
below the bottom left spell it says "Crocodile". When I put it 1 pixel
under the bottom right spell it says "Repulsion". Even though there are no
Crocodiles or Repulsions on the board, nor are those the next 2 spells in
my spell list. Oops I clicked the mouse button and now I've selected
"Repulsion" as my spell! Now I discarded the imaginary Crocodile. Ok it
really let me cast the Repulsion. NEXT TURN: The bug is now gone.
NOW FIXED by tossing a -1 into the math equation.
* ADDED some new wizard names.
* BUG: Ok I'm playing a test game. On turn 1 I vanished Player 8. During
the next spell selection I got that exact same enforcer hit in
Chaos.c/GetSpellSelection/IntelligentComputerSpellSelect/IsExposedWizard
that I reported before. Now that I realize this is a problem with not
checking the .warped bit all is NOW FIXED.
* FIXED the warped problem in sqDistanceFromNearestTeamWizard and
sqDistanceFromNearestEnemyWizard now that GetWizardCell(p) returns -1 for
a warped wizard. Though maybe I should be checking the .warped bit
instead. I just don't know which method will be easiest to maintain.
BUG in the sasc "diff" command. It can't handle files with extremely long
lines. Numerous enforcer hits are generated and then the computer crashes.
Found by attempting to diff single.c with the previous version.
What is the purpose of all those CONST keywords that you added into text.c?
* EDITED descriptions of OgreWarrior, Ogre Assassin and Ogre Mage.
Since the Ogre Mage description says he is trained in the medical arts I
gave him special combat of -1 against life.
* Changed Texas Trade'em into Texas Trash'em since you don't trade spells
in, you trash them (discard them).
* PROBLEM: when you cast a spell it tells you the range, which isn't very
useful. I would much rather know the multiplicity so I know how many
attempts I get with the spell. I've been wanting this feature since the
first time I played the game years ago; I could never remember how many
attempts of Justice, Dark Power and the various tree spells I was going to
get. This made it difficult to plan where to cast my trees. NOW FIXED.
* SHORTCOMING: Q key does not work on the spell list. NOW FIXED.
* BUG: At the beginning of a person's movement phase there is text left over
from the previous person's movement. NOW FIXED.
* 2 NEW SPELLS: Magic Wand and Vodka. Neither have a real graphic yet. I
won't make any graphics till I implement the graphics upgrade. I just had
to program these in real quick while I still remembered where to put the
code fragments that make them work.
Hint to myself: If you add new stuff to the wizard structure then you must
do a smake clean or there will be all kinds of horrible, strange and even
humorous bugs (like computer wizards suddenly becoming human wizards,
humans getting to pick computer wizard's bonus spells for them, and dead
wizards that still cast spells). Found this all out the hard way.
************************************* TEST GAME ************************
I'm playing a test game as player 2 against all the computer controlled
wizards.
Turn 1: Player 1 casts Plasma Beam on nobody. Moves away from his enemies.
Turn 2: Player 1 casts Plasma Beam on nobody. Moves away from his enemies.
(he is now on the edge of the screen).
Turn 3: Player 1 casts Plasma Beam on nobody. I guess he is attempting to
move off of the board because now there are zillions of enforcer hits then
the game locked up.
All the other wizards and creatures acted normal.
The enforcer hits didn't put cpr on a line of code. It just put it on some
assembly code, presumably because the hit happened in an OS routine. So I
have NO idea what was causing all this. 8(
NEXT TIME I PLAY A GAME SAVE IT EVERY TURN!
All this was caused by an uninitialized variable. When I added the Vodka
spell I made a new variable "wavy". I had:
UBYTE wavy; instead of the correct UBYTE wavy=0;
So the wavytask was being stopped even though it wasn't running. This
resulted in memory being freed which hadn't ever been allocated in the
first place. A really good way to crash the computer.
It was all just a simple little mistake. ALL FIXED NOW.
**************************************************************************
* BUG: Computer players keep casting Demonic touch and then aborting it even
though there are low-combat creatures nearby! NOW FIXED.
* REDUCED Thundermare combat to 12.
* BUG: I just killed a wizard and for my bonus spell I picked the Crimson
Death. It says its probability is 226% instead of -8% like it is supposed
to. NOW FIXED.
* BUG: the "q" key no longer works on the alt-o spell list like it used to.
I found this by pressing alt-o in the editor. Then I clicked on the Ghost
which showed me a list of all undead flying creatures. I wanted to read
the description of the Crimson Death but the Q key did not work. 8(
Fixed by SAI. NOW FIXED. But OOPS I actually wanted to see the stats of
the creature, not read its spell-description. Maybe we should have "q" and
"Q" in the editor? ???
* BUG: the 2nd tier of alt-o objects does not erase the first tier like it is
supposed to. Fixed by SAI.
**** Another Playtest game *****
Somehow there is a sleeping lion that is being ridden by a computer wizard.
The lion just moved. Then it cast a Griffon. I don't know how that happened.
The mounted wizard has Irvine's invulnerability. Couple of turns later:
now the lion has died and there is an empty cell that says
Nothing (Torquemada) has 31 life, 7 recovery, 4 MR, 15 Man, 15 Intelligence
and 1 combat. It says that all its original stats were 0.
It has the following wizard powerups:
Invulnerability, Recover Boost, Elf Boots, Brain Boost, Armor.
I don't know what caused this and I don't know how to fix it.
********************************
* BUG: A sleeping Vortex is moving around the board! NOW FIXED.
* Vortex description no longer says it leaves a trail of distorted space in
its wake.
**** JCformat Rules! ***********
I had a mysterious error from the C compiler like this:
void HandleMOUSEMOVE(int mx, int my, int sp)
chaos.c 2380 Error 218: declaration found in statement block
I looked at the code prior to this line and couldn't see the problem.
I was even looking directly at the area of code where the problem was but
didn't see it for whatever reason. Then I used JCformat on chaos.c
and it told me: Error in line 2235: Ending does not match beginning. Thus
I fixed the problem within 5 seconds of running JCformat when in the olden
days before JCformat I'd have gotten frustrated and just went off and
watched some tv to take a break and would have lost hours of productivity.
*********************************
* NEW FEATURE: The "c" key now works on your spell list! I've been wanting
this feature for years. Now that I've got it, it is totally cool! You
can _instantly_ determine all the potential targets of any spell in your
list. This is so much easier than having to read the 2nd info screen of
a spell to see if it is allowed to be cast on certain types of things (like
growths or inanimates or corpses) etc. etc.
* UPDATED THE DOCS for "c" key and multiplicity.
Monday, April 12th, 1999: New phone line installed. I now have reliable
24 hour access to the net. If the Chaos internet upgrade was completed
today I could immediately start running a full-time internet game server.
**************************************************************************
ALGORYTHMIC SPEECH UPGRADE
**************************************************************************
* BUGS: The speech for Lich Lord and ShapeChanger doesn't work due to a
typographical error in the phonetic spelling. All these years I thought
you had intentionally left out speech for the ShapeChanger. Oh well,
its NOW FIXED.
* FIXED the awful pronunciation of "Justice", "Castle", "Confidence",
"Coercion", Ogre", "Ogre Mage", Ogre Assassin", "Ogre Warrior" and
"Falcon". Justice had been pronounced "Justayce" for years and "Falcon"
had been pronounced "Foilcon" for years. NOW FIXED.
* PROBLEM: the spell manager issues warnings when I put a period at the end
of a phonetic string. There should not be a warning for this. Erroneous
warnings are also issued for the chars: ,()? NOW FIXED.
* IMPROVED PRONUNCIATION of ALL SPELLS. I should have done this years ago,
its so easy. And I only intend to use the algorythmic speech for a few
more months before I replace it with digitized speech. Oh well. There
were just sooo many spells which were using 1 or more wrong phonemes.
Certain spells had the correct phonemes but had the stress reversed
(stress on 2nd syllable when it was supposed to be on the first or vice
versa.)
Almost every single spell file has changed now. COMPLETED.
Certain words like Agathion, Achiyalabopa, Abath, Amphisbaena, Bodak,
Hybsil, etc. are not
in my dictionary and I have never heard them spoken by a human being before
so I really have no idea how they are supposed to be pronounced. I'm just
leaving mysterious words like this unchanged.
Apparently people in New Zealand don't pronounce the letter "r".
I found many words, e.g. "Wizard" which simply had no "r" phoneme in them
like as if you had intentionally removed it. Since we americans pronounce
our "r"'s I have changed this. Example: "WIH4ZAXD" is now "WIH4ZERD".
Similar for "Vampire" and "Vulture".
If you don't like this we'll have to have an option for "American Speech"
and "New Zealand" speech.
Some spells like Aviary didn't even have speech. Now they do.
I didn't change the speech for Goblin Bomb and Hidden Horror so that people
can sneakily cast them without their opponents noticing. hehehe.
**************************************************************************
* PROBLEM: We were playing a multiplayer game. At some point while most of
us were out of the room somebody moved some stuff around on the table by
the keyboard. This resulted in a joystick falling onto the keyboard and
resting on the return key. This made everyone end their turn at about 1
second intervals. I know this isn't much of a _real_ problem but still...
I have now implemented End of Turn Confirmation. NOW FIXED.
* End of Turn Confirmation addresses Joseph Dixon's complaint about the
end-of-turn gadget being at the bottom of the screen and JJ's complaint
about it being at the top of the screen. It no longer makes any
difference where it is since if you accidentally press it it will still
bring up the requester and ask if you are sure you want to end your turn.
******** CastInfo + Spells Upgrade **************************************
NOTE to SAI: In my opinion there should be CAST_NOWIZARDCELL and
CAST_NOEXPOSEDWIZARD flags for IsIllegalCast to test. This would allow us
to simplify the hints of certain spells since hints are not needed to
prevent something that is illegal in the first place. The reason I want
this is that if you point the mouse at the "Free" spell in your list and
then press "c" it highlights all the wizards on the board even though that
is a guaranteed failure. Such bits would improve the gameplay, usage and
implementation of Alter Reality, Betrayal, Dark Power, Exorcise, Free,
Kill, Nuke, Sleep, Subversion and Wake.
* Now Implemented aforementioned CAST_NOWIZARDCELL and CAST_NOEXPOSEDWIZARD
bits into CastInfo.
* CastInfo[] is now ULONG instead of UWORD. I had to make a small change
in spellman.tex to accomadate this.
* Betrayal, Free and Subversion can no longer be cast on Artifacts.
In my opinion, if a spell is guaranteed to fail on a certain type of cell
then there should be a CAST_BIT for that in the CastInfo[] array.
* FLAW c key on Raise Dead says you can cast it on your own wizard!
We probably either need a CAST_NOLIVING bit or a CAST_MUSTBEDEAD bit.
This problem is solved below.
* AAAAAAAAAUUUUUGGGGHHHHH!!!! MAJOR BUG!!! I just played a test game and I
just cast Raise Dead on an enemy wizard. The Enemy wizard wasn't dead.
He is now MY wizard and he's undead!
You can also cast Raise Dead on your own wizard to make him suddenly
become undead! This is all caused because of the
lame way of defining classes of objects according to the highness or
lowness of their ID number. Someday I'll go through and eliminate all that
stuff like I've been wanting to do for years. But for now I'll just hack
in a quick fix. NOW FIXED.
* Ok now I've removed all that ID checking code crap and replaced it with
IsCreature(cellp) instead. Well how about that, there are no
isCreature(cell) or IsCreature(cellp) macros.
* NEW MACROS isCreature(cell) and IsCreature(cellp) and isIDcreature(id)
NOTE: The game is a database. Therefore all data should be contained in
the database and not in any way be dependent on the numerical value of the
ID number being above or below some other numerical ID number.
All occurences of things like:
IF somethingID <= ImpID
should be replaced with something like:
IF isIDCreature(somethingID) // or IF isCreature(cell) // or IF IsCreature(cellp)
* REPLACED all occurrences of > ImpID with the appropriate creature macro
and all occurrences of <=ImpID with the appropriate creature macro
in cast.c, all spell files, move.c, and some of the ones in spell.c
* Note to SAI: As I was doing the above I found some code in cast.c that can
never be executed. You should probably look at it. Just search for
the LAST occurrence of CatLordID and you'll see it. SAI Fixed the code.
* There are still numerous occurrences of ImpID sprinkled around in various
files but some of them look like they might be using it in a strange way so
I didn't mess with them + I'm very sleepy at the moment. I'll leave the
others for SAI. ALL occurences of ImpID have now been replaced by SAI
except for the ones in spellman.tex and reincalc.c.
The ultimate goal is that someday there should be no references of > someID
or < someID.
Ok, now the game is completely messed up. I just now found out the hard
way that InitialData[] only exists up to the highest numbered inanimate
object. So the isIDcreature macro doesn't work when given a magic spell id.
(For example the game thinks the VodkaID is a creature when in fact it
is just a magic spell like Teleport.)
Ok, but the isCreature and IsCreature macros seem to be working ok.
* CHANGED isIDmacro from:
#define isIDcreature(id) ((InitialData[id].Stat & CREATURE_STAT))
to
#define isIDcreature(id) (id<=Wizard8ID and InitialData[id].Stat & CREATURE_STAT)
**************************************************************************
****** Artifact + Sleep Problems **************************************
Casting sleep on an artifact puts it to sleep but since its owner is
calculated right after that, it never says that it belongs to ASLEEP.
Thus you cannot see if it is asleep or not.
If someone casts sleep on an artifact that belongs to you it will be
technically put to sleep (so it will collapse at some point) but it will
still belong to you and you can still attack with it.
* SOLVED by modifying CalculateArtifactOwners to ignore sleeping artifacts.
***********************************************************************
* REMOVED Temporarily all the ADPCM code from the game since I probably
won't really use it for a few more months till the OS2.04+ version and to
save memory on the FINAL 1 meg version.
********** Major playtest game of Jerry vs. James. ********
Jerry started with 3 wizards on his team 2 were controlled by him and a 3rd
was computer controlled. I started with 2 wizards on my team controlled by
me. The remaining 3 wizards were all computer controlled and on their own
team. No artifact, no scrolls, no Texas Trash'em, 3 generators.
* BUG: Sometimes computer controlled wizards attack their ally's
creatures. This only applies to computer controlled _wizards_. The
Creatures of the wizard don't get engaged to or attack allies, only the
wizard himself. Basically computer wizards are trying to mount their
ally's mountable creatures. The problem was in ChooseDestination
NOW REWRITTEN AND FIXED.
BUG: I'm not sure what I did but I may have rapidly hit the lmb then rmb
near the top of the screen (but I don't think I was in the menu area, more
like the 1st or 2nd row of cells). The game then said "Mind Flayer" even
though there were no mind flayers on the board and in fact the ENTIRE area
of the board that I clicked in was completely empty. It said I had 0
movement points and I couldn't moved or cancel or do anything 8(
Essentially the game was locked up since I couldn't really do anything.
This happened in a really important game between myself and my brother.
Luckily I was running the game under cpr so I hit escape and single stepped
through the code and FORCED the new_cell variable to be USER_RMB which
cancelled my turn. I guess this proves that the RMB was being trapped when
it wasn't supposed to. Anyway, once I did that the game proceeded
normally. I remember seeing this bug before a very long time ago. Perhaps
1 or 2 years ago. I may have just exited from an info screen right when
this happened. I don't know for sure. Leaving this for SAI.
JC fixed this bug months later in November 1999.
* BUG: Somtimes computer wizards cast Plasma Beam for 2 or 3 turns in a row
on empty space. Leaving for SAI. Fixed by JC months later on October
20th 1999. NOW FIXED.
Jerry cast Triple on the first turn so I cast Coercion on the first turn to
negate that. However, he was coerced for 3 or 4 turns but this apparently had
NO EFFECT on his Triple spell once the coercion wore off. When the coercion
wore off, he still had his triple in force for a long long time thereafter.
Is that the way it is supposed to work?
I always thought that spells like Triple work for a set number of game
turns, regardless of other effects.
We found out that many spells, like Torment and Coercion, hurt your allies
as well as your enemies. Is that the way it is supposed to work?
**************************************************************************
TORMENT BUG #1:
My wizard cast Torment and it lasted a few turns for each wizard, including
my Ally wizard. So I simply didn't cast any creatures for a few turns,
waiting for it to wear off. But it didn't wear off so I waited a few more
turns. This went on for around 10 turns and it never wore off so I figured
it must be set to last for at least 1 creature cast so I cast a tormented
creature and sure enough that triggered the removal of the torment. The
spell description says "... the effect will hold for several turns of each
wizard".
So either
A) The spell needs to be reprogrammed to really work for several TURNS or
B) We need to change the docs to say "creature casts" instead of "turns".
* TORMENT description changed to say that it works for several
"creature casts".
TORMENT BUG #2:
The Torment spell description says that it influences the creature casts of
"the opposition" when in fact it influences the creature casts of ALL other
wizards including your allies. So we need to either:
A) Change the description to say "all other wizards" or
B) Reprogram the spell to really only work on opposition wizards.
* TORMENT description changed to say that it affects "all the other wizards"
* COERCION description changed to say that it affects "all the other wizards"
I'm not saying this is how I want Torment et.al. spells to work. You made
the spell so its up to you. I don't know how they "should" work, nor do I know
if it even makes any difference. I'm just saying what I have done for the
time being to correct the incongruencies. However a spell works, its
description should be accururate and not misleading.
****************************************************************************
WEIRD BUG: I cast a tormented Crocodile. At some point (1-3 turns later) the
crocodile mysteriously healed back to full life! The same thing happened
to all 3 of Jerry's tormented Vultures! How is this possible?
Leaving for SAI.
* BUG: Jerry cast Restoration on my cloaked wizard and it technically removed
the cloak but it never redrew the wizard, so for the rest of the game it
looked like he was cloaked on the board, but in fact was not. NOW FIXED.
* BUG: Jerry cast "Orcs" while having a Magic Wand so I told him to press
the "c" key to see where all he could cast his orcs but the "c" key didn't
work! It doesn't seem to work on any multiplicity spells. NOW FIXED.
BUG: "c" key over an Orcs spell in your spell list highlights your wizard
and NOTHING ELSE. This is because the Orcs spell is defined as CAST_FREE.
Something needs to be done about this so that all multiplicity spells will
correctly highlight all the legal cells like they are supposed to.
Leaving this for SAI.
It was an extremely close game up until turn 20.
Game over on turn 30. Jerry killed me. I don't think he could have killed
the independents though, as there was a Devil walking around + other stuff.
***************************************************************************
* FINAL 1 MEG VERSION DONE on April 19th, 1999. The disk is 99% full with
only 9 blocks left. Here is a list of the main floppy dir.
Directory "df2:chaos" on Monday 19-Apr-99
fonts Dir ----rwed 01-Dec-98 19:25:17
Music Dir ----rwed 16-Jan-99 14:29:53
talklists 9354 ----rwed 14-Mar-99 09:52:32
Chaos 343076 ----rwed Today 20:17:05
chaos.prb 6800 ----rw-d Today 16:48:00
classic.prb 6543 ----rw-d Today 16:48:00
pool.ssc 43545 ----rwed Today 16:58:57
Start_Chaos 311 ----rwed 31-Mar-98 05:49:42
Start_Chaos.info 2570 ----rw-d 01-Dec-98 20:10:17
chaos.dat 66688 ----rwed Today 17:02:00
8 files - 2 directories - 953 blocks used
Memory Consumption during Intro:
Chip RAM: 467608
Fast RAM: 382376
Memory Consumption during Setup:
Chip RAM: 459224
Fast RAM: 469624
During the game:
Chip RAM: 267000
Fast RAM: 482728
During info screen:
Chip RAM: 281000
Fast RAM: 483384
During the "About" Requester:
Chip RAM: 369000
Fast RAM: 483488
During the "Save As" Requester:
Chip RAM: 299400
Fast RAM: 486952
During the "Quit Game" Requester:
Chip RAM: 317800
Fast RAM: 483344
* PLAYED 1 test game on 7Mhz 68000. Everything seemed to work ok, but the
"End Turn" confirmation was too slow. Oh well.
* Chaos_2.5r and Chaos_2.5d are both in /ChaosArchives/ directory.
* Uploaded v2.5d demo version to Aminet. Upload rejected as usual.
* Worked on music for several days then:
**************************************************************************
HARD DRIVE CRASH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ALL PARTITIONS LOST !!!!!!!!!!!!!!!!!!!!!!!!!!
DAY OF DOOM!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
AAAAAAAAAUUUUUUUUUUUGGGGGGGGGGGGHHHHHHHHHH!!!!!!!!!!!!!
I can't access the source code, my word processor, my email, the internet,
the compiler.... NOTHING...
This was EXTRA bad because I'm using an Amiga 3000 with the ROM in a file
in DEVS:Kickstart, which means if the hard drive doesn't work then neither
does the computer.
After getting really depressed for a couple of days I finally started
looking for my old 120 meg HD that used to be in my A3000. That took an
entire day and I was unlucky enough that it was in the LAST place I looked.
(as in I gave up because I had looked EVERYWHERE except this one last box,
it was the only thing I hadn't looked through... well whaddayaknow there it
was.)
Ok, so I put the old drive in and I could at least boot up my amiga.
LUCKILY I was smart enough to have installed some basic internet software
on that drive before removing it and throwing it in the shoebox or I would
REALLY have been dead in the water. Unfortunately I had only tcp/ip and
irc installed. So no web browsing or ftping for me. 8(
It was like being teleported back in time to 1989 8(
Well after talking to numerous people on the net and doing lots of research
about hard drives for a whole week, I finally figured out the problem and the
solution.
The problem was: The original AmigaDOS had a limit of a 4gig drivesize.
(I had thought it was a 4gig partition size). That's right, in 1985 when
Bill Gates compatible PCs had a 40 meg limit, the Amiga had a 4096 megabyte
limit. The amiga has a 32-bit operating system and the largest number that
a 32-bit number can hold is exactly 4 gigs.
WHAT HAPPENED: When I wrote a file to the hard drive it "wrapped around"
from the 4gigth block to block 0 and overwrote the Rigid Disk Block and
associated data blocks that keep track of what partitions are on a drive
and where they are located. This happened because the HIGHEST partition is
my WORK partition of 1.6 gigs size and this is the one I put all my stuff
in. It was 49% full at the time of the crash.
The solution is any 1 of the following:
A) Don't use drives of larger than 4 gigs.
B) Use drives of larger than 4gigs but don't actually use more than 4 gigs
of its space.
C) Upgrade to the newest FFS (FastFileSystem) which is 64 bit.
Since my drive was already formatted under the old FFS I just took the easy
way out and did option B. I repartioned my drive to not use the upper 20
megs of space. Losing 20 megs out of 4,300 megs is irrelevant.
HOW I RECOVERED MY DATA: I just used RDB-Salv from Aminet which went in
and figured out where my partions were, how big, etc. It worked perfectly
on the first try. Then I repartioned my drive with HDtoolbox to the
correct specifications (the exact same ones as when I set it up
originally). Then I used DiskSalv from Aminet to salvage all files off the
1st partition. The 1st partition is my boot partition with workbench and
it was partially overwritten in the crash.
Disksalv recovered EVERY file except for 3. 1 of the files was easily
replaced from its original source. The 2nd file was just some useless
program I had downloaded once upon I time so I just deleted it. And the
3rd file was a mysterious unknown and unused file of complete irrelvance to
anything (I guess it was left over from some old program I once deleted).
There were numerous other small problems that arose from me switching my
hard drives around, these were related to improper SCSI termination (since
I don't have the manual to the 120 meg drive) and to not doing "save
changes" in HDtoolbox.
Recovery operation completed on May 15th, 1999. For the previous 12 days
no work was accomplished on Chaos and I got really stressed out.
HARD DRIVE REPAIRED
***************************************************************************
***************************************************************************
JJ BUG REPORTS on v2.5r:
* BUG: Game does not work. This turned out to be because he had renamed
the game dir to "Chaos 2.5" and the path determination code couldn't handle
spaces. This never would have happened if we had made the game require
OS2.04 or higher since then we'd just use PROGDIR: NOW FIXED.
-------------------------------------------------------------------------
* LOAD/SAVE BUG: If you save a game with wizards in trees then reload it
there is a MAJOR problem: When the tree collapses the wizard is invisible
and "he's there but not really there" which makes him impossible to kill.
Ok, this was because the WizardInfo structure said UBYTE id instead of
UWORD id. NOW FIXED.
* LOAD/SAVE BUG STILL THERE: The loading and saving routine had the
following problems:
From the Load Routine:
// j is an int so this doesn't work right.
// This reads the wizard id into the upper word of the int j so the id
// will ALWAYS be wrong.
fread ((char *)&j, sizeof(USHORT), 1, fh);
wiz->id = FileCode[j];
From the save routine:
// j is an int so this doesn't work right
j = InternalCode[wiz->id];
fwrite ((char *)&j, sizeof(USHORT), 1, fh);
// This Writes out the upper word of the int (which is always 0)
ALL NOW FIXED.
--------------------------------------------------------------------------
When he saves a game it says "save complete" but then the hard drive
flashes a few seconds later. He thinks that if you don't WAIT for this to
happen that it messes things up.
* COMPLAINT: He always plays as player 8 so when he saves the game he has to
WAIT for all the first 7 wizards to reselect all their spells. Therefore
he doesn't bother saving the game anymore since its too annoying.
This same thing has been bothering me (JC) for some time now but since I
always play as player 1 or 2 it didn't bother me badly enough to try to fix
it. I was going to fix this problem when I add internet capability to the
game since the current gamesave just WON'T work with internet play.
It must be modified to allow for saving at ANY person's spell-selection
point, not just player #1's.
But since it is such a problem for JJ we might need to fix it sooner.
TEMPORARILY BAND-AID PATCH FIXED by reducing BASE_DELAY from 2 seconds to
2 tenths of a second. IMPLEMENTED.
save at beginning of spell selection phase.=YUK.
* MAJOR BUG: highlight ? with mouse then click on some cells. It will lock
up quite frequently. Usually happens with cells on the upper right of the
board.
Note from JC:--------------------------------------------------------
I have now verified that this bug is NOT caused by his Qmouse Mouse
accellerator. It is in fact caused by a bug in OS 1.3 and below. It
happens when pressing the mouse button (the right one I think) in the dead
area between the 2 screens on the information panels.
I absolutely, positively DO NOT have this bug on my A3000 with OS 3.1.
There may be a work around for this but I don't care. Its just another
good reason to hurry up and make the game require OS 2.04 or higher.
---------------------------------------------------------------------
ABOVE BUG NOW FIXED on OS 1.2 / 1.3 by hacking in some "IF OS <= 1.3 THEN
TrapRMB" code.
* MAJOR BUG: Right Mouse Button on load/save screen under OS 1.3 locks up the
program. This is caused by the fact that the requester opens its own
window without the TRAPRMB bit set. I don't know any way to make the
requester open a TRAPRMB window. So we need to work around this bug some
other way or just require OS 2.04 or higher. OK, I have simply turned
off the MENUVERIFY feature for the HiResWindow during the loading and
saving screens and now it works perfectly under OS 1.3. NOW FIXED.
* MOVED TrapRMB and PassRMB #defines from chaos.c into defines.h
* COMPLAINT: he puts in the wizard names for each player with a number on
the end to indicate their player number. Then he plays a game. Whenever
he starts a new game it then RE-randomly generates all the names over again
and he has to re-enter the numbers on the end. Ok, I have now fixed this
so that names are only randomly generated once when you first load the game
and then never again. NOW FIXED.
END OF JJ Bug Report.
**************************************************************************
* FLAW: A human wizard can no longer attack a tree that is occupied by
another wizard. It just says "already occupied".
I Changed this to not attack if the tree is occupied by an ally, otherwise
attack the tree even if the tree itself is on your team. Ditto for all
meditations. This change does not affect computer wizards and does not
allow any of your own creatures to attack your own meditations.
NOW FIXED.
* NEW FUNCTION GetWizardCodeSameTeam to support above feature.
* SPEEDED UP: Lissajous box menu thingies.
* BUG: I move my player 2 wizard into my ally's dark citadel and now I can't
move him out! He's trapped! This was caused by the the fact that the
"clear movement bit" code was OUTSIDE the main loop! So the MOVED bit was
only being cleared after all players had moved! Thus I never noticed this
since for player 1 (who I usually play) the MOVED bit was properly cleared.
But for ALL other players the MOVED bit was set totally wrong. I went back
and looked at all the old source code versions on my HD and they all have
this same bug! ack. NOW FIXED.
* Compiled a new v2.5 and this is REALLY the final 1 meg version.
Around June 1, 1999?
* My car blew up. No work accomplished for 2 weeks.
* bought a used car. It broke down within 24 hours. No work accomplished.
* My mom's car broke down. No work accomplished.
* CHANGED: Killing a generator now allows you to pick from 4 bonus spells
instead of only 2; thus reflecting the extreme difficulty of killing a
generator.
* BUG: Computer wizards cast vodka on artifacts a lot, this effectively wastes
the vodka spell. I have now simply removed the CAST_ARTIFACT from the
CastInfo field so this is NOW FIXED.
Alleged Bug: I just cast Seperation on a cloaked computer wizard and it
didn't seperate him!!! He is still in an alliance with all the other
computer wizards!!!!! No, that is just the way the spell works. You don't
cast it ON anyone. It is a cast_free spell that just seperates yourself.
* BUG: If you save the game while Tormented, then reload, you suddenly have
a MagicWand and Vodka powerup. NOW FIXED.
* BUG: Depth removes line-of-sight requirements but its description says
it is only supposed to allow unlimited range without changing line of
sight requirements. This is due to a limitation in the spellcasting engine
that any spell with max range automatically does not require line of sight.
There is currently NO WAY to have a spell have unlimited range yet require
line of sight. So we need to either reduce the range of Depth down to 14
and edit the description accordingly, or we need to change the description
of depth to say that it removes line of sight requirements also. Or we
could change depth to be that it doesn't change range but it removes line
of sight requirements. Or ???
OK, here is what I did: I changed the Depth description to state that you
get unlimited range + you don't need line of sight.
* NEW SPELL: Crystal Ball. This spell removes line of sight requirements
for all spells.
* NEW SPELL: Ubiquiscope. The Ubiquiscope is like a combination of Crystal
Ball + Magic Wand.
* 11 NEW SPELLS: Fly, Singular Earthbind, Dual Earthbind, Nonarchery, Convert,
Sword of Sassenrath, Cursed Sword, Mount, No Mount, No Grow, The Exorcist.
I haven't made any new graphics for any of my new spells. I'm hoping this
will help motivate me to do the graphics upgrade. The only exception is The
Exorcist which I pirated the graphics from the Bandit and made the Bandit
use the graphics from the Annis, then I deleted the Annis since it didn't
seem to have any real purpose. The Exorcist still needs to be redrawn so
that he is holding a cross in his hand.
BUG in Spellmanager: The following lines from Ubiquiscope cause a fatal error:
ComputerAssist:
Imagery: STATIC
Leave this for SAI.
BUG in something: When processing the 2nd image of the new animated bandit
the compilation stops with "Invalid Section Code". I have temporarily
worked around this by making the bandit be STATIC once again. Leaving this
for SAI to fix.
-------------------------------------------------------------------------
I stayed up all night playing a serious game.
Lately I've been playing the game a lot with me controlling 1 wizard
against all the other computer wizards who are all on the same team against
me. 99 spells, unlimited turns, 6 artifacts and 6 scrolls, 4 artifacts,
Texas Trash'em, Computer Level 0, no classic, no impurities, no agent
casting. I can almost always win. I frequently win under 20 turns.
Maybe I was just having good luck?
So today I played as above but with only 5 artifacts and 5 scrolls. I lost
3 games in a row. Once on turn 3. Once on turn 8. On my 4th game I was
FINALLY able to win on turn 73. For the last 15 turns of the game I was
getting dangerously low on spells. It was a constant struggle to shoot
down walls with my bolters in order to keep getting a fresh supply of
spells rolling in.
In the beginning of the game they were blowing my creatures away left and
right. I had no chance. So I got in my castle and hid out while they
built this ridiculously HUGE army of mega-powerful super-duper-turbocharged
powered-up creatures. I was going to DIE as soon as my castle collapsed
but then someone cast alliance on me. HA HA. So I spent a jillion turns not
really knowing what the hell I was going to do or how on earth I could win.
blah blah blah. Turn after turn went by. I had NO shooting creatures so I
couldn't "accidentally" shoot my allies. To make it worse I didn't even
have any brain drains to go kill a wizard. All I did was eventually cast
some wall spells to box in 2 of the wizards. I used my creatures to box in
a 3rd one. (I had only killed one wizard at the beginning of the game.)
To give you an idea of how powerful these guys were, they went around
mowing down all the generators, even though the dragon nests produced LOADS
of dragons for them to fight.
Then lo and behold, a wizard cast a bolter wall right into the middle of
the board and things started looking up for me! I quickly cast subversion
on it, then recover boost, then double, then simulacrum then cloak then
replicate. One of my allies was even nice enough to cast Range Boost on
one of my newly acquired Bolter Walls. hehe.
With my new army of 5 bolter walls I was ready to whoop some ass but I was
surrounded by jillions of trees, gooey blobs, dragons, undead creatures and
you name it. The board was about 90% full. So it took me FOREVER to be
able to kill an enemy wizard. Then 2 forevers to kill the next one.
I got so many bonus spells that by the end of the game my wizard was so
powerful that he could cast ANYTHING ANYWHERE he wanted. I was casting
Grizzly Bears halfway around the board. hehehe.
My score was 3031 which was 7x higher than anyone elses. But the whole
opposing team combined had well over 2000.
--------------------------------------------------------------------------
* BUG: I vanished wizard 6 and then there was an enforcer hit on his turn!
This only happened on the turn IMMEDIATELY after I cast vanish on him.
It never happened again after that. Ok, this was a problem with the game
trying to move a wizard who had been warped. I have now fixed MoveWizard()
to check the .warped bit and exit if it is set. NOW FIXED.
* MODIFIED isStupidCast to prevent casting of Speed and Fly on Bolter Walls.
* NEW FLAG: FLAG_HIGHCR for the Archery and Nonarchery spells so that
computer wizards will use them more intelligently.
* BUG: There is something wrong in the movement routine! The Exorcist can't
move! It says "Cannot attack the living" when trying to move into an empty
space! There are no other creatures nearby. Happened on turn 1.
The problem was in isInvalidAttack() NOW FIXED.
* BUG: uhmmm.. I've killed every single thing on the board and the game
isn't ending. This was caused by GetMass() not returning the correct
number. NOW FIXED.
* BUG: uhmmm.. I've killed every single thing on the board and the game
isn't ending. This was caused by LoadLevel() not setting the "Level"
variable correctly (it was some totally weird number when it should have
been 0). NOW FIXED.
BUG: Enforcer hits on score screen at end of game. I encountered this once
and then I was never able to duplicate it. So I have no idea how it
happened. ???
* PROBLEM WITH VICTORY CONDITIONS: When playing the game with the default
settings of 4 generators you sometimes win on the first turn without even
doing anything! (when the generators don't generate anything on turn 1).
So I changed it so that to win the game you must now either kill or block
all independent generators. NOW FIXED.
* PROBLEM: When I select "Save as" I like to save the game with the turn
number as part of the filename. But then I have to go back and check the
score panel, then do save as again which is annoying. So now I display
the turn on the "Save as" panel and the "About" panel too. NOW FIXED.
* When the game ends it now tells you WHY it is ending.
ENFORCER HIT: I shot and killed my own wizard with my Blue Dragon and then
when I ended my turn it caused an enforcer hit. Leaving this for SAI.
* UPLOADED v2.5d DEMO version to aminet on Sunday, June 27th, 1999.
*************************************************************************
BEGIN MUSIC UPGRADE
*************************************************************************
June 27th, 1999:
The dir Chaos_2.5/ has the FINAL 1 MEG VERSION in it.
The dir Chaos_2.6/ has the version with the new music in it.
* MUSIC is now played during spell-selection phase. I played a couple of
test games with 6 theme songs installed and it was MUCH better than 0 theme
songs like we've had in the past but it still wasn't nearly enough.
* The game feels MUCH more upbeat with the new music!!!!
* BUG: When starting a new game the colors on the HiRes part of the setup
screen are all wrong and it is positioned wrong too. FIXED.
* BUG: When starting a new game the colors on the HiRes part of the
gameboard are wrong. FIXED.
* BUG: Several of the new Sidewinder protracker mods won't work with the
playroutine. They are playing EXTREMELY slowly. I converted them to
MED MMD1 so this is NOW FIXED.
* MODIFIED the game so that if you turn off sound and speech then the music
plays continuously through the spell-selection, spell-casting and movement
phases of the game, only changing at the beginning of the next turn.
* INCLUDED CD advertisement for Sidewinder CDs into the docs.
*** Color My World Modifications ***********************
* Shortened the intro.
should be at 52: c-3 a#2 b-2
Sequences with main tune:
12,13,14,15,16, 17, 18, 19, 20, 45, 46, 47, 48, 51, 52, 71, 72, 75, 76,
11,09,09,12,10, 13, 14, 15, 16,
12 has a bleep that I might remove.
13 has breaking drumbeat I might remove. Nah leave it alone.
* BAD NOTE: 02 had a bad sounding note so I copied the block to 65 and
fixed it. block 02 is no longer used.
block 11 has extra stuff in it that interferes.
Block 11 is just like block 36 except for track 3 which is totally
different.
* I didn't like the way block 11 sounded, the notes from 2 different tracks
were colliding with each other so I copied 11 to 64 and then wiped out
track 2. Block 11 is no longer used.
* NEW BLOCK:
I was absolutely certain about all the changes I made so far but for this
next one I'm not at all sure. I made a new pattern 66 and couldn't decide
where to put it or if it should even be in the song? How do you decide the
order or your blocks? Do you use some sort of formula? Or do you just
throw them in there randomly? I've always wondered about this.
I put it near the end.
***************************************************************************
* BUG: sometimes wizards cast Plasma Beam for some strange reason.
then they always cast it up to the left, even if nothing is there, or even
if it attacks multiple creatures that they own while not hurting any
enemies. Leaving this for SAI to investigate. Fixed by JC months later on
October 20th, 1999. NOW FIXED.
* BUG in protracker play routine. There is a bug in the playroutine that
causes certain protracker mods to play back incorrectly. It sounds like
the notes are being played back about 100x too slowly. I have no idea how
to debug this so I'm just converting the affected mods to MED format.
Converted LOTS of protracker mods to MED MMD1 format.
* NEEDED: Dear SAI, could you please adjust the loading and saving such that
player 3 can save the game, and then when reloading the game it will reload
to player 3's spell selection phase? Thanks. Implemented by JC in August
1999.
I am currently under death threats from Brian Dixon and my car has been
vandalized twice so I am under duress and I must now move.
ReleaseSemaphore(&SourceCode) by JC on July 3, 1999.
ObtainSemaphore(&SourceCode) by SAI on 5 July, 1999.
* OBSOLETED: EditPopupIDCMP is now handled my the main HandleIDCMP routine.
This means that "q" querying etc. now works properly in the editor.
* Temporarily turned off the end of turn confirmation as I find it annoying.
* The menumode variable is now local to HandleIDCMP.
* Improved the implementation of the popup creature menus using an array
of functions.
* Tidied up documentation in editor.c.
* Fixed a bug in ClearBoard().
* Fixed an incorrectly line relating to the CatLord in cast.c.
* Examined the remaining occurrence of ImpID occurring in the source.
I was able to replace most of them with isIDcreature type constructs.
The following occurrences remain:
-- in the enumeration in defines.h (pretty obviously needed)
-- in io.c (1 occurrence) in probability saving block
[[ actually this code looks broken because it is only saving
spell probabilities for creatures ]]
-- in reincalc.c (1 occurrence). Since this is not compiled into the
final game, I'm happy to leave this one alone and avoid having
to include extra files.
I eliminated all occurrences from spell.c, but because of how the
loops work this file (among others) still depends on all creatures
coming before other spells!
Note from JC: it will be like that for a long time to come because I
won't have time to fix it for a very long time.
ReleaseSemaphore(&SourceCode) by SAI on 19-August-1999
ObtainSemaphore(&SourceCode) by JC on August 19th, 1999
* End Turn Confirmation is now an option in the menus. Default is OFF.
* PROBLEM: The "about" screen with the pentagrams hashes sometimes. It
hashes a lot and looks utterly terrible under heavy CPU load. NOW FIXED
by increasing the taskpri to 100 during the doublebuffer switching.
* PROBLEM: The credits scrolling is not 100% smooth and is very jerky
under heavy CPU load. NOW FIXED by increasing taskpri to 100 during
the doublebuffer switching.
***************************************************************************
* NEGATIVE SCORE BUG: I played a game against JJ and I won but my score
was negative and his was positive so he claimed he was really the winner.
In the current version of the game shooting the following scrolls gives
the following points:
Scrolls of creatures award as many points as the original life of the real
creature.
moveit -124
Pox shield -125
acid rain -123
devastation -1
touch of god -116
ball lightning -114
plasma beam -113
sword of sassenrath -118
cursed sword -110
nomount -86
Other scrolls have various (mostly HUGE) positive scores associated with
them. This is all caused by bad subscript errors. Points are awarded
according to the .Life statistic. But Magic Spells don't have a
.Life statistic so it just accesses some other data.
Simply replace all occurrences of ScoreAdd(player,InitialData[id].life)
with IF IsScroll(cellp) THEN
ScoreAdd(player,1)
ELSE
same line as before
END_IF
Made required changes to DevastationHandler() also.
DONE AND FIXED.
*****************************************************************************
* Above fix increased the filesize of cast.o just enough to start producing
Error 502: Reference to function > 32768. So I had to change the
makefile for cast.c to use code=far. NOW FIXED.
* BUG: DeathBringer struck a scroll dead. NOW FIXED.
* PROBLEM: We keep getting Emails from NTSC users who don't know how to
PALboot their Amiga. I added in the AmigaToPAL cli command which
requires OS 2.04 or higher. Now the game automatically puts the computer
into pal mode. FIXED.
* BUG: Pressing 'q' on the creatures on the alt-o menu thing shows the
spell description instead of their stats. NOW FIXED.
* PROBLEM: I was implementing Spell-List editing so I made a new file
"SpellListedmenu.dat" and I adjusted the makefile to run menumaker on it
just like edmenu.dat. But this produces 2 different files, each with their
proper menu data, but each uses the exact same same variable names!
I have worked around this by hand-editing SpellListedmenu.c so that all
variables start with "sl".
Is there a more general way that you want to work around this?
****************************************************************************
***** Spell-List Editor Upgrade *****
****************************************************************************
Since SAI has become burned out on coding and the game is suffering from a
lack of attention I have hatched an ingenious plan! }8)
I have decided to implement a Spell-List editor for Chaos this way
(hopefully) I can get SAI to design some levels for me to have fun playing.
This will allow us to maintain development momentum.
These days I have very limited time to spend working on the game and this
was the simplest coding upgrade I could think of. It took me my entire 2
days off + 1 work day to implement it. This doesn't bode well for my other
upgrade plans. 8(
Now that we have spell-list editing we can start making REAL levels for
Chaos! YAY!!! Now when I come home from work and I'm too tired to
program, maybe I'll have enough energy to do some level designing.
Implement Spell-list editing ROUGH NOTES:
* 0. Have a seperate spell-list editor which is different from the "board
editor"
* 1. Its easy. Just make a SpellBoard for storing the spell list onto.
DONE.
* 2. You select "Edit Spell List" from the Main Menu. DONE.
* 3. Figure out where the code goes when you select "Edit Spell List" ???
DONE.
* 4. delete copy and paste work exactly the same as in the board-editor.
DONE.
* 5. Modify HandleIDCMP + make new menu. DONE.
* 6. Need CopySpellsFromListToBoard(player)
(do this once at the beginning + anytime the player number is changed) DONE.
* 7. Need CopySpellsFromBoardToList(player)
(do this whenever you select "quit" or change player number) DONE.
* 8. Need alt-i for "insert" an empty space into the spell-list. DONE.
* 9. Need alt-d to delete just as in the board editor unless it is used
on an empty cell in which case the empty cell is deleted and all cells
to the right are scooted 1 space to the left. DONE.
Anytime you select a player number the SpellBoard is cleared and rebuilt
with the selected player's spell list.
then by pressing alt-o it switches to the backup board and displays all the
available spells just like in the board editor.
alt-o MUST switch from board to backupboard and then back to board!
Don't switch back to realboard!!!! Because sometimes board will be
realboard and sometimes it will be spellboard.
Choose a spell, switch back to the SpellBoard, and place it in the spell list.
Only the first 150 positions are used. You should normally only use the
first 99.
Upon exiting the first 150 positions on the SpellBoard are copied into the
real spell list of the player.
When you place a spell it goes "on top of" the one that is already there.
Thus you can immediately delete a just-placed spell and the old spell will
be there. A miniature undo feature.
August 26th, 1999
Ok, now the Spell-List editor works great but... I still haven't
worked out how to fix the gamesave format to save on a particular person's
turn! 8( I shouldn't start designing any levels till I figure that out
and modify the gamesave format accordingly.
******************************************************************************
***** END of Spell-List Editor Upgrade *****
******************************************************************************
******************************************************************************
***** Gamesave Format Upgrade *****
******************************************************************************
* currentPlayer is now saved.
* BUG: ExorcistID is listed in the translation table twice! FIXED.
* BUG: Probability information was not completely saved. FIXED.
* BUG: the currentSpell was being saved but not translated. FIXED.
* BUG: When you save the game it resets back to player 1's turn. FIXED.
* BUG: When you load a game it resets back to player 1's turn. FIXED.
* REMOVED old stuff that is no longer needed.
August 31st, 1999
OK, now gamesaving works perfectly! You can save on anyone's turn and
upon reloading it reloads back to that player's turn.
* BUG: The FavoriteFoodID and RunsAwayFromID is not translated like all the
other ids. So the first time we add a new spell to the game, all our
previously designed levels will have creatures with messed up tastes and
fears. NOW FIXED.
* ADDED: Lots of extra BYTES, WORDS and ULONGS to the header block for
future expansion. This way I hopefully won't need to convert levels from
old format -> new format everytime I add a new option to the game.
* ADDED: Lots of extra BYTES, WORDS and ULONGS to the cell structure for
future expansion.
* ADDED: Lots of extra BYTES, WORDS and ULONGS to the char_stat structure
for future expansion.
* HOPEFULLY I can now do a complete major upgrade or 2 or 3 and not have to
convert all the old levels up to the new format.
******************************************************************************
***** END of Gamesave Format Upgrade *****
******************************************************************************
******************************************************************************
***** Line of Sight Upgrade *****
******************************************************************************
* BUG: If you are trying to cast a roper or bolter wall etc. along a 45°
angle, the "l" key will show that you have line of sight but sometimes the
"c" key says you don't! And when the "c" says you can't cast it there you
really can't cast it there even though it is in range and you have line of
sight! This is caused by a problem in isLineOfSight. isLineOfSight
_SHOULD_ work perfectly but it doesn't. I don't know why. Its like it is
off by 1 or something. This problem only occurs when there are generators
adjacent to the 45° path. If you want to investigate this mystery then
please do so. In the meantime I have solved the problem by replacing all
occurrences of isLineOfSight C code with isLineOfSightQ asm code. NOW FIXED.
* SPEEDUP: Computer controlled shooters now decide who they will shoot over
2x as fast as before!
* SPEEDUP: Computer AI is now MUCH faster than before!
* SPEEDUP: "c" key is now over 3x as fast as before!
* SPEEDUP: "s" key is now much faster!
* BUG: isLineOfSightQ does not automatically return TRUE when the source
cell is the destination cell. (This prevented me from casting Combat on
myself) NOW FIXED.
******************************************************************************
***** END Line of Sight Upgrade *****
******************************************************************************
* FIXED various bugs with the Mass Ressurrect spell + pox or reincarnation
or vanquished foes. It was all very broken. NOW FIXED.
*************************************************************************
** Remove Owner from the animation byte and transfer it to its own byte**
*************************************************************************
Methodically go through and replace all >> 3 occurences with a
GetPlayer() call. Replace all occurrences of << 3 with a
ChangeOwner(cell) subroutine that does everything needed to change the
owner of a cell to another person.
* All occurrences of PLAYER_MASK, << 3 and >> 3 have been REMOVED from all
spell files.
* All occurrences of >> 3 have been REMOVED from chaos.c, info.c, move.c
and predicate.c
* All but 1 occurrence of >> 3 REMOVED from core.c (it refers to oldflag).
* All but 1 occurrence of >> 3 REMOVED from editor.c (it refers to buffercell).
* All occurrences of << 3 have been REMOVED from chaos.c and init.c
* Did not replace any occurrences of << 3 in core.c as all the uses seemed
to be very lowlevel.
* Backed up the Chaos_2.61 dir to Chaos_2.62. Work will proceed in
Chaos_2.62 dir.
* Redid the cell structure so that there are .owner and .oldowner bytes
* All remaining occurrences of << 3 and >> 3 REMOVED!
* Anywhere there is a reference to .oldflag will be added a reference to
.oldowner. DONE.
* Check all references of .flag and if refering to player number then replace
them with .owner. DONE.
* Went back and looked at EVERY usage of .flag, ->flag, .oldflag and
->oldflag and looked for anything susupicious and fixed it.
* Eliminated 40 occurrences of code like "& PLAYER_MASK >> 3" and
"|= Player << 3" Thus saving at least 360 bytes of code.
* WizardInfo structure now has a .owner byte also. Modified BackupWizard()
and RestoreCellWizard() and io.c appropriately.
* ALL files 100% cleaned up!
* Played a test game. Saved and Loaded multiple times. Everything works.
* Sending to SAI on September 9, 1999.
*****************************************************************************
** END Remove Owner from the animation byte and transfer it to its own byte**
*****************************************************************************
* NEW FUNCTION: CenterWriteText
* REGISTERED USER on September 17th: a nice chap from Ireland mailed in his
registration fee. He has an AGA Amiga 1200 tower with Zorro IV Busboard,
Picasso IV gfx card, 50 Mhz 060, 64 Megs of RAM, Power Flyer, etc.
* Added Sidewinder to the Scrolling Credits.
* Played Sean's Levels 1-4 and 10. Added turns_left to the about screen.
* Added Registered_Text to hold the registered user's name.
******************************************************************************
***** Exploration Mode Upgrade *****
******************************************************************************
I was originally not going to implement exploration mode until the graphics
upgrade programming was done. But since I have extremely limited time
these days I've re-ordered my priorities to do this upgrade first since it
seems nice and easy and provides the MAXIMUM improvement in gameplay.
When exploration mode is on you cannot see cells which you have not
explored. Once you have explored a cell it stays permanently explored,
there is no need to maintain line-of-sight to the cell. This makes the
gameplay nice and simple, the way I like it.
Most creatures simply explore the cell they are in and all adjacent cells.
Some creatures, like Eagles explore further and can see behind walls due to
flying high in the air.
Other creatures, like snakes, can "feel" the movements of other creatures at
far distances, thus allowing them to map cells which are hidden behind
walls that cannot be seen by normal creatures.
Certain other creatures can hear or smell other creatures.
This adds the "Explore-the-Map" play mechanic to the game. You can't see
any cells until you have sent a unit to map them. Once mapped the cell
remains visible forever even if you have no nearby units or no
line-of-sight.
You can also see the cells that your allies can see. But if they stop
being your ally then you can no longer see those cells.
I love games where you must explore the level and map it out.
Having Exploration Mode turned ON makes the game MUCH harder since you
have no idea what direction you should be going in the early stages of the
game. Nor do you have any idea what direction you will be attacked from
at first.
Exploration mode makes computer movement more CPU-intensive which is
why I waited so long to implement it. Now that the game is aimed at a 2
meg 020+ amiga it shouldn't be a problem.
Exploration mode doubles the amount of fun generated by the game IMHO.
I was going to wait and implement Exploration after I did the graphics
upgrade but due to my extremely limited time I had to reprioritize things
and am now implementing the simplest upgrades first.
Rough Notes:
I added ExploreCell(cell) line of code to the following routines:
RestoreCell
RestoreCellWizard
InsertCreature
WarpIn
Growth
the teleport spell
MoveTempest
MoveVortex
CrMove1
cMoveEngaged
cMoveNonEngaged
CalculateArtifactOwners
WakeUp (used by Subversion, Betrayal and Wake)
* REWROTE Charm, Raise Dead, Mass Ressurrect and Swap spells to use
ChangeOwner()/changeOwner() or InsertCreature
Hopefully that is all the places that needed it. Can you think of any
routines that magically cause a creature to appear somewhere that don't
use the above routines? If so they probably need ExploreCell(); added
somewhere.
* 0. Modify io.c to handle loading/saving all the new stats. ALREADY DONE.
* 1. Convert spellman.tex into a real JC file since I will be editing sm.c.
DONE.
* 2. You MUST have a real cellnumber for the ExploreCell() routine!!!!
Because you hafta do sqDistance from the cell numbers! DONE.
* 3. Write the real exploration routine. DONE.
MUST TAKE INTO ACCOUNT CanBeSeen or CantBeSeen!!!!! DONE.
Change CanBeSeen into CantBeSeen etc. DONE.
Take into account sleeping, dead, scrolls and nobody artifacts. DONE.
* 4. Adjust AutoMouse Routine. DONE.
* 5. Adjust information panels. DONE.
* 6. Adjust ReDrawCell. DONE.
* 7. Adjust animator task. DONE.
* 8. Make ChangePlayerView Routine. DONE.
* 9. Modify sm.c to handle all the new stats. DONE.
*10. Add the stats into the spell files. (Only nonstandard creatures need the
stats added in. Others use the built-in defaults.) DONE.
I made all snakes feel out 6 squares.
Snakes cannot be felt, smelled or heard. Only seen.
All living flying creatures don't need LOS to see. And most see out 2
squares.
Eagle, Falcon and Vulture have Excellent eyesight.
Spectator, Achiyalabopa and Harpy have poor eyesight.
Vulture, Dire Wolf and Arctic Wolf have excellent sense of smell.
I couldn't really decide what to do about other creature's senses.
I keep saying eyesight but maybe I should really change it to
"cartography"?
Still need to consider flying undeads.
Still need to consider some ground creatures which can see out 2 squares
and requireLOS.
Perhaps archers and ogre mages could have excellent eyesight?
Useful table of sqRanges:
1 = just the 4 adjacent cells.
2 = all 8 adjacent cells. (out 1 diagonally)
4 = (2 horizontally)
8 = all 16 adjacent cells. (out 2 diagonally, 2 horizontally)
9 = (3 horizontally)
18= out 3 diagonally (4 horizontally)
32= out 4 diagonally (5 horizontally)
36= (6 horizontally)
50= out 5 diagonally (7 horizontally)
72= out 6 diagonally (8 horizontally)
98= out 7 diagonally (9 horizontally)
**** OOPS! Now I remember why I was supposed to wait until the graphics
upgrade was complete before I implemented all this stuff! All those cloak
images drawn on the board for player 1's view are blocking LOS for
everybody! If I had done the graphics upgrade first this would not be any
problem at all. Drat. ****
*11 solve the problem of all those cloaked cells blocking los for the
computer players while player 1 is watching the action!
A. Calculate AutoFailArray. Easy. If it isn't explored then its
autofail else its not. DONE.
B. When you explore a cell you 0 out that element of AutoFailArray +
you recalc the AutoAcceptArray for that cell. DONE.
C. Modify JC LOS routine to take into account AutoFail. DONE.
D. Make the AutoFail() function just like AutoAccept() Function. DONE.
E. Make the AutoFailArray[] just like AutoAcceptArray. DONE.
F. Make the CalculateAutoAcceptAndFail FUNCTION. DONE.
G. Modify asm code to use AutoFailArray. DONE.
H. OOPS. Above mods didn't work due to lack of registers so I'm
ELMINATING the AutoFailArray[] and using AutoAcceptArray[x] == -1
to mean that it is an AutoFail cell. This saves a register in the asm
code and it also saves 1 instruction in the main loop.
This new way is super efficient. DONE.
Normally I would simply have the "board" displayed to the screen using
cloaked cells for unexplored cells. And all LOS calculations take place on
the shadow board which has the shadow masks of every cell there all the
time no matter what. + unexplored == autofail. Everything would work
perfectly and effortlessly and quickly.
Ok but i don't have the shadowboard yet because I haven't done the gfx
upgrade yet so I will just hack in a secret rastport which has the images
of everything for los calculations.
So redrawcell and animator will simply draw 2 images, one to the display
based on playerview, and 1 to the shadowboard which is the real image.
LATER ON it will draw 2 "images" but the 6 bitplane images only go to the
screen and the shadowboard only gets a 1 bitplane image. (The ShadowMask
which will all be done automatically by my asm cellrendering routines which
I coded like 2 years ago!
Damn this whole double rastport method will be slow and lame and waste
TONS of chipmem!!!
I need to do the gfx upgrade so I can do the REAL shadowboard!!!!
This hacked-in method is messing up the sound effects! (Really this is a
problem with the sound effects system being dependent on cpu speed.)
I. Create ShadowBoardMem, ShadowBoardBitMap and ShadowBoardRastPort
along with initialization and cleanup code. DONE.
September 21st, 1999. My evil mom broke my $550.00 Commodore 1950
Multisync monitor! ARRGGHHH!!! I had to switch back to my $50.00
Commodore 1084S. ack. Now I hafta use 640x256 resolution! I'm back in
the stone ages! I'm going to die of lameness!
J. Modify ReDrawCell and Animator Task. DONE.
K. Modify LOS routine to use the ShadowBoardRastPort when
ExplorationMode == YES
This requires creating a new LOSBitPlane variable which normally
will = LoResBitPlane but when ExporlationMode==YES
LOSBitPlane will = the first byte of the first bitplane of the ShadowBoard.
Setup and Asm Code properly modified. DONE.
* TESTED OK September 22, 1999: Ok at this point I have never actually
tested any of the above modifications A-K. So I just set PlayerView==1
and ran the game to test out the above changes. EVERYTHING WORKS PERFECTLY!
Its totally amazing! Geez I must be a 40th level megacoder! I can explore
the map and I can't see the enemies, its totally kewl!
Well my Vulture (which can see 3 cells) and my Pegasus (which can see 2
cells) are totally mapping out the board super fast. This has convinced me
to reduce the sightranges of all flying creatures.
Vulture and Eagle will see out 2 squares diagonally. All other flying
creatures will be set to see only 1 square out just like the ground
creatures (except flying creatures don't need LOS so if their sightrange
ever gets increased they'll be able to see over walls and things.) DONE.
* 12. Replace all occurrences of HighLightCell= with a call to the new
HighLight() function which will check that the cell is visible to
the current PlayerView before highlighting it.
HighlightCell=-1 becomes HighLight(-1); etc. ALL DONE.
* 13. Entering the board editor or spell editor should set ExplorationMode=NO
and upon exiting it should be returned to its former status. DONE.
* 14. Changing spell-selection phase, spell-casting phase or movement
phase to a human player should do a ChangePlayerView(); DONE.
* 15. Cell effects which only affect 1 cell need to be modified so that if
the cell is not visible to the current PlayerView then they are not
drawn. I don't know if they should still make the sound or not???
I simply made CellEffect() do nothing (no gfx or sound) if it is
taking place in an unexplored cell for now since that was the easiest
way to do it. DONE.
* 16. Make MaskWritePixel(); function for use by the graphical effects in
ExplorationMode. DONE.
* 17. ThreeBeam has a flaw in that it sometimes writes pixels to negative
coordinates. The OS clips these and doesn't display them but still it
shouldn't be trying to write pixels to -1,-2 coords. NOW FIXED.
* 18. ThreeBeam needs to be modified so that the pixels which would have
been plotted in unexplored areas are not. Only pixels which plot into
explored areas really get drawn. Replace all WritePixel() calls with
MaskWritePixel() which will return 1 if it wrote the pixel and 0 if it
wrote nothing. Add up the return values and if >0 then do the AUDIONote
else don't. DONE.... Later on... I have now decided that I like
hearing the sounds of what is going on in unexplored regions so I no
longer mask the sound on this effect. DONE.
* 19. Modify PlotBreath(), PlotBolt() and BirdShot() as above. DONE.
* 20. Modify BoardEffect() to not do the effect on unexplored cells. DONE.
* 21. Modify Cycle() / Bow weapon. This automatically fixes
WeaponEffect() and WeaponEffectDrawer(). I intentionally
left the sound effects in place and only hide the graphics. DONE.
* 22. Lightning() will be left as it is because there is no easy way to mask
it. If you cast it you reveal your position. DONE.
* 23. WizardExplode() will not be masked simply because I like to know when
an enemy wizard has died, even if he dies in the vast expanse of the
unexplored regions. DONE.
* 24. New function: CompletelyRecalculateTeamExplore(); This function must
be called any time the teams change for any reason. DONE.
* 25. Alliance, Separation and core.c "death of wizard" code modified to
use CompletelyRecalculateTeamExplore(); Tested and works great! DONE.
* 26. Exiting the spell editor or board editor doesn't redraw the board right
because REDRAWALL doesn't redraw all those empty explored spaces!
So I changed ReDrawAll to redraw everything (even empty spaces)
IF ExplorationMode==YES. DONE.
* 27. At beginning of game set playerview to 15 since that will show a solid
grey board. DONE.
* 28. September 29, 1999: The next problem requires a change to the gamesave
format so I am starting a new version now. Begin Version 2.6.3.
* 29. MAJOR PROBLEM WITH REPULSION: The Replusion spell copies cells around
using board[x]=board[y] style code. But this copies the exploration
bits to so it ends up exploring areas that you've never been too and it
looks buggy.
Also the clone, hyperclone and warp spells use board[x]=board[y] code
which means they are copying around the exploration bits of players that
they are not supposed to!
Also the movement routines and other places use board[x]=board[y] style
of coding producing imperfect results for ExplorationMode.
POSSIBLE SOLUTIONS:
A. Make a new "CopyCell" routine which copies everything EXCEPT the
exploration info.
B. Take the exploration bits out of the cell structure and make them
their own array.
I have opted for Option B because it is the easiest and most logical
way to code it.
There is now an Exploration[] array and an ExplorationTeam[] array.
I have removed them from the cell structure and modified the macros and
exploration code appropriately.
This neccessitates a new block of code for the gamesave/load routines.
ALL DONE.
* 30. FLAW: I was playing a test game in ExplorationMode and I started out
with Triple, Red Dragon, Replicate, Cloak. So I had 6 red
dragons, 3 of which were cloaked so I was trying to explore the map as
fast as possible so I was flying each dragon deep into unexplored territory.
I clicked on my cloaked dragon and moved him deep into an unexplored
area and the game made a funny noise and my dragon was gone! At
first I didn't know what the hell had happened. Then I realized
that I had flown him into a pit. Poor little dragon 8(
NOW FIXED with informative text message.
* 31. A computer player cast Vengeance on wizard 1 while it was on wizard 2's
view and it showed the spunge effect on the unexplored cell! Wrong.
Its not supposed to do that! Modified SpungeColour() to use
MaskWritePixel() NOW FIXED DONE
* 32. The Following spells need to be investigated/modified to call
ExploreCell() in an appropriate manner: Repulsion, Replicate,
Simulacrum, HyperClone, Teleport, The time when any creature warps back
in to the board, Turmoil, Vortex, Tempest, Roper teleportation,
GrowthRoutine, Horror, Passsage. ALL DONE.
Please keep in mind that from this point on if you copy cells around you
must have a corresponding ExploreCell() call. Furthermore if the
original cell is being erased then the ExploreCell() call must happen AFTER
the original cell is erased (for line-of-sight reasons).
Question: Should inanimate objects and growths explore cells just as well
as living creatures? I am thinking that maybe we should set their
sqSightDistance down to 0 so they will only explore the cell that they are in
and no further. What do you think I should do? On the other hand leaving
things as they are means that casting Meteor Storm is actually usefull now
and it also can prompt human players to cast walls and trees around wildly
in an attempt to spot generators or dragons. So I think I'll leave things
as they are.
At this point (September 30th, 1999) I have already played numerous test
games and everything has apparently worked ok but there is one fundamental
thing still to be done in order for creatures which have long-range sensory
perceptions which require Line-Of-Sight. (I don't think there are currently
any such creatures, but there will be one day.. or such creatures will be
manufactured through the use of magic spells). This brings us to #33.
* 33. BUG: Any creature with e.g. sqSightRange of 32 and SightRequiresLOS==YES
can't actually see that far because the close-up unexplored cells
block LOS to the further away unexplored cells therefore:
ExploreCell() must be modified to sort all the cells on the board
into ascending order of distance from the observer. Then this sorted
list of cells will be used instead of just going through the cells
from 0 to 239. NOW FIXED AND DONE.
PLAYED a test game with the sound off. I controlled 2 wizards against 4
generators with Texas Trash'em OFF and no artifacts or scrolls.
ExplorationMode=ON. Boy the game sure is harder when ExplorationMode is on
and Texas Trash'em is off! I LOST THE GAME ON TURN 26. I had been
fighting for my life in a hopeless battle for several turns. I'm glad they
finally put me out of my misery.
One interesting thing is that I cast my Meteor Storm on turn 3 and it
helped me map out the level quite nicely.
If I had played the game where both my wizards were in an alliance then I
think I could have won the game but I never had LOS for Wizard #2's
RangeBoost to be cast on Wizard #1's Elf. That one problem ruined
everything for me. If they had been in an alliance they would have had LOS
to cast powerups on each other. My score was 219+82.
* 34. Speed up the "derive Cell from pixel coords" code in MaskWritePixel by
using my LSRCellHeightShiftBitMultGAMECOL[y] technique from cell.c. DONE
* 35. NEW MACRO CellFromPixel(x,y) using maximum speed technique. DONE.
* 36. ChangeExplorationMode() routine. DONE.
* 37. Modify all Numeric keypresses to check that the cell is really visible
to the current PlayerView before highlighting it.
PROBLEM: when you press the "c" key over a spell which "works over the
entire world and does not require line of sight" on the first turn of the
game, you can sort of cheat and see the positions of enemy wizards.
This applies to Armour, Cursed Sword, Dark Power, Vengeance, etc.
What should we do about this?
A. Leave it as is. (and this will explain why computer players use such
spells on creatures they can't "see")
B. Change the "c" key to only highlight explored cells, even though the
cast is legal.
C. Simply add a new CAST_NOTONUNEXPLORED or CAST_EXPLOREDONLY bit to certain
spells such as Vengeance, Dark Power, Justice, Armour, Cursed Sword, etc.
Probably every spell which doesn't need Line-of-Sight would need
CAST_NOTONUNEXPLORED. Also add "Cannot cast on unexplored cell" to the
2nd info panel of the spell information thing.
I have chosen option C and have modifed EVERY SPELL which does not need LOS
except for the following exceptions:
I Intentionally did not add CAST_NOTONUNEXPLORED to the Bury, Magic Glass,
Iridium, MassMorph, Mutate, NoGrow, Pit, TheExorcist, Singular Earthbind,
Spectator, Teleport, Thundermare, Vodka and Weak Wall. If there are any
complaints about this then I can add it in to these spells too. I'm not
too sure about all this. Only time will tell.
Should I also add CAST_UNEXPLOREDONLY for the proposed mapping spell
that lets you map out a bunch of cells?
* PROBLEM: Pressing the 'l' key on a blank cell only highlights that cell
and the 8 adjacent cells because the owner of that cell (NOBODY) has not
explored any cells. I put some special code in AutoFail() so now the 'l'
key works like it always did. NOW FIXED.
* BUG: Moving a creature into an unexplored cell causes him to not be
highlighted anymore, even though he still gets to shoot. The problem is
that the destinationcell is being highlighted before it has been explored,
thus the highlighting is not shown. NOW FIXED.
* 38. Added CAST_NOTONUNEXPLORED to the spellinfo screen. DONE.
* 39. Added SightRange, FeelRange, SmellRange and HearRange to creature
info panel 2nd screen. DONE.
* 40. Changed the Ghost and Drelb so they can't be felt or smelled. DONE.
* 4 NEW SPELLS: Cartography, Alternography, Seismology, Telescope.
Alternography majorly kicks ass!
* After adding the new spells I loaded up the old levels to see if they
still worked and ... THEY DO! 8)
* BUG: Highlight() routine is highlighting the computer wizard's creatures
even though they are in areas which are unexplored by me. NOW FIXED.
******************************************************************************
***** END Exploration Mode Upgrade *****
******************************************************************************
Before I implemented the ExplorationMode upgrade, I had worked out the full
details of the "Play By Email" upgrade and it was going to be easy for me
to implement it. But the ExplorationMode makes "Play By Email"
implementation far more complicated.... i.e. I no longer know how to do it.
* CANCELLED: The Play by Email upgrade has been CANCELLED until someone
registers the game who has a netconnected Amiga.
* New routine DepthWriteText to replace FancyWriteText which only has the
outline thing down and to the right 1-4 pixels. Much faster + looks
better. DONE.
October 3, 1999: My mom poisoned me with insecticides and hair spray so
I'm extremely ill. So I can't work :( Symptoms of my illness include, my
entire body aches, I have no strength to stand up, any input of food or
water causes a violent output reaction. Fever 101.5. I can't lay down or
I throw up. I can't move or I throw up from extreme nausea, its like
having super severe motion sickness. I must sit perfectly still. Diarhea,
stomach ache, etc.
So I will just playtest another level.
Playtest SAI LEVEL 7.
Level 7: The game says I won on turn 14 even though my wizard was about 2
turns away from the exit. I would have won 1 turn sooner I think but there
is a bug in the game where if you move a creature next to an undead and get
engaged and try to attack it then the game gets stuck and you can't cancel
the creature's move without clicking the "end turn" gadget. Sometimes "end
turn" cancels just that 1 creature's move. But this time it ended my turn
and I didn't get to move my other creatures!!!
I have now tried to duplicate this bug by playing various test games and
the bug is not reoccurring. My unicorn was adjacent to some inanimate
objects when the bug happened and maybe this is somehow affecting things.
This is an example of a time when I should have saved the game every turn
so I could replay that turn and see what is happening.
Ok I reloaded the level and replayed it and uhmm... the bug is gone. I
can't make it happen again. It must be some very technical thing that
happens. 8( UNSOLVED MYSTERY.
* BUG: When loading a game, probabilities are all messed up on the info screen!
Just save every translated spell id, then every probabilty.
ID,prob
ID,prob
etc...
Ok I made the changes but it still doesn't work!
Ok I tried a different method and it still doesn't work!
4th attempt: Ok I got it working now. It was a problem with the
translation. I will really be glad when the game is a proper database so
we can get rid of all this lame translation crap!
Total time wasted 2.5 hours. NOW FIXED.
* UPGRADED All SAI's Levels to the new format successfully.
* YUCK! Some color combos in the credits intro are terrible. I have
made a better color combo for the bright red text. DONE.
* FLAW: When a Bolter Wall is the last computer controlled thing to move it
stays highlighted well into the next phase of the game. Way longer than it
is supposed to. NOW FIXED.
* I tried to duplicate the "Kill your own wizard and get an enforcer hit"
bug but every time I kill my own wizard there is no enforcer hit. ???
* DOUBLED the speed of ClearBoard();
* PROBLEM: It takes me forever to find the spell I want when I'm designing
levels and testing things. SOLUTION: Alphabetized the list of objects in
the alt-o object chooser menu. DONE. SOLVED.
There should be a menu option like "Pick Object" or something so we don't
have to press "alt-o" all the time. Leaving this for SAI.
* DARK WOOD INCONGRUENCY: The description says they are undead but their
undead_stat is not set. NOW FIXED.
* AAUUGH! I cast animate on an independent generator and nothing happened!
I have now changed the spell description to say "This spell has no effect
on generators." FIXED.
****************************************************************************
******* My First Level Playtest Notes *******
****************************************************************************
1st attempt: I was dead on turn 9. All 6 generators generated on turn 1.
I had no chance.
Independents had score 87, life 358. I had life 0, score 9.
Jerry's First Attempt: He died on Turn 10.
Independents had score 93, life 295. He had life 0, score 8.
Attempt 2: I died on turn 11. Independent life 261, score 78.
My life 0, score 45.
Attempt 3: DAMMIT I WAS GOING TO WIN AND THIS STUPID MudMan thing with 0
maneuverability just moved next to my wizard and killed him even though he
should have been engaged to my zombie!!!!! Engagement routine needs to be
investigated!
Reloaded the savegame from a few turns back but this time the generators
were meaner to me and I died on turn 18.
* ENGAGEMENT ROUTINE FIXED: The routine now works like this:
If you are next to 1 enemy creature THEN
If you have 0 maneuverability you are ENGAGED.
If you have 15 maneuverability you are NOT ENGAGED.
If you have 1 maneuverability you have 1 chance in 15 of not being engaged.
If you have 2 maneuverability you have 2 chances in 15 of not being engaged.
The engagement system is now totally logical and easy to understand.
Attempt 4: Won on turn 41. My life: 147 Score 1161
Independent life 0 score 64. I was only able to win because I killed a
generator and then got a Dragon Nest as my bonus spell. But I suppose that
just makes up for my lousy luck during the rest of the game. If you can
survive till turn 30-something you start getting really good spells that
allow you to become an effective offensive fighting force.
** Found the Secret Scroll **
Attempt 5: Won the game on turn 11.
Level 2: I won on turn 25. Wasn't really very hard.
Level 3: I died on turn 5! A Basalt Golem charged up at me from unexplored
space and whacked my already weakened wizard and killed him! I had NO idea
he was out there!
Level 3: Attempt 2: I died on turn 16!
****************************************************************************
******* END My First Level Playtest Notes *******
****************************************************************************
* PROBLEM: You can't install Chaos to your HD by simply dragging the drawer
icon to the HD because the req.library must also be copied to the LIBS:
I have now changed it so that it will open the library from LIBS: or from
the libs/ dir in the chaos dir so now the game is SUPER EASY TO INSTALL!!!
NOW FIXED.
Ok I am now going to implement 2 new spells. One will make an inanimate
object become a creature and the other will make a creature become an
inanimate object. So what do I call these 2 spells?
Inanimorphobiosis or "Stone to Flesh" or "Animate"?
The trouble with calling it "Stone to Flesh" is that it doesn't turn
"stone" to "flesh" it turns any inanimate object (such as trees) into a
creature. However this would make the spellname be the converse of the
"Flesh to Stone" spell.
The trouble with calling it "Animate" is that it doesn't animate the
graphic of the recipient. It will still be a static image. OOPS there is
already an "Animate" spell.
Petrify or "Flesh to Stone" or Deanimate?
OK, for now I will have Stone to Flesh, Inanimorphobiosis and Flesh to
Stone. Inanimorphobiosis will be a stronger/rarer version of Stone to Flesh.
Mass Petrification will be a stronger/rarer version of Flesh to Stone.
* 4 NEW SPELLS: Stone to Flesh, Inanimorphobiosis, Flesh to Stone, Mass
Petrification.
Stone to Flesh and Inanimorphobiosis are extremely powerful. I need to either:
A) Reduce its probability.
B) Make it a bonus spell.
C) Make it have a CAST_NOGENERATORS
D) Make it so that it doesn't change owners.
I'm going with option D for Stone to flesh and option B for
Inanimorphobiosis.
* I went back and modified most of my spells to use implode cell effect for
when something bad is happening to the recipient and implode+explode cell
effect for when something good is happening to the recipient. DONE.
* SOUND EFFECTS fully reinstated in ExplorationMode. I have decided that I
like to hear all the sound effects of events that happen in unexplored
areas so I modified CellEffect() to only mask the gfx in unexplored areas
NOT the sound effects. DONE.
* BUG: Intro credits monster list sometimes has messed up colors.
This was a problem where I had MSGRandom()%4 instead of the proper
(MSGRandom()%3)+1 NOW FIXED.
* SPEEDED up the intro credits a bit.
* SMALL BUG IN JCformat: Whenever a program line uses a \" after a " there
is sometimes a messup in the alignment and/or a bogus error gets reported.
No data is lost but it just isn't aligned right. This could be seen in
sm.c which has a lot of \" constructs. I had to add an additional test to
2 routines. This is all NOW FIXED.
* ELIMINATED 2 hardcoded references to Wizard8ID and replaced them with
IsCreature() test.
* VODKA changed to allow you to cast it on the independents. Now the spell
is actually useful for something :)
* CAST_ARTIFACT added to spell information screen.
* BUG: Enemy Computer wizard cast Stone to Flesh on my wall for me. I have
now added FLAG_OWN to the spellflags so that computer wizards will only cast
this spell on their own creatures. NOW FIXED.
* CHANGED SWAP: to not swap inanimate objects.
* BEGIN v2.80
*****************************************************************************
***** ATTACHED SCREENS UPGRADE (OS 3.0 Required) *****
*****************************************************************************
COMPLAINTS:
We have received complaints from AES and others about the game using 2
seperate screens because they typically run lots of programs and flip
between them a lot so sometimes the screens get out-of-order.
I have now (finally) dug up the information on attached
(parent/child/family) screens and OS 3.0 is REALLY AWESOME!!
OS 3.0 screen handling is vastly superior to OS 2.04!
SOLUTION: Set up the main lores screen as the parent screen and attach
the hires screen to it as a child screen. This method will be used on OS
3.0 systems and the original code will be used on OS 2.04 and lower
systems so the game will still run on all versions of the OS.
I've been wanting to have LOTS of screens open at once even though I'd only
be using 2 of them at a time. But I haven't ever implemented that because
under OS 2.04 that would just be TOOO annoying to have to press amiga-m/n 5
times to switch out of Chaos.
The use of attached screens also allows me to have as many screens open as
I want without annoying anyone. All unused screens will be hidden. This
is going to be really kewl.
* IF (OS >= 3.0) THEN OpenAttachedScreens ELSE OpenUnattachedScreens. DONE.
* Modify MoveScreen() to transparently handle the old and new systems. DONE.
Ok I just tried it out and this is really AWESOME! The screens now appear
as one. If you drag one screen you drag them both so they can't get out of
place! And you can't depth-arrange them wrongly either! This is exactly
how I always wanted it to be! This is a great reason to upgrade to OS 3.0+!
*****************************************************************************
***** END ATTACHED SCREENS UPGRADE (OS 3.0 Required) *****
*****************************************************************************
*****************************************************************************
***** WHY CHAOS DOESN'T WORK ON A GRAPHICS CARD *****
*****************************************************************************
The cell highlighting when you press a numeric key uses direct memory
writes. Cyberygraphics and Picasso96 do not support this.
The animated sprite used to highlight the currently active creature uses OS
routines with no direct manipulation. Does this work on your gfx card?
Gfx cards are lame and have 0 or 1 sprites. The fancy gfx cards which have
1 sprite are already using the sprite for the mousepointer so it can't be
used to highlight a creature.
The wavy screen effect used for various spells, (most notably vodka), uses
the copper. Gfx cards are lame and don't have a copper so this just isn't
going to work on a gfx card.
The game uses 2 screens (each in a different resolution and color depth)
onscreen at once. I do not think that cybergraphx supports this. Does
Picasso 96?
The game uses color cycling. Most gfx cards are lame and don't support
color cycling.
I would love to make a gfx card compatible version of Chaos which would run
in 24 bit color with superawesome graphics in 640x480 or higher resolution
but since I don't _own_ a gfx card and neither does my programming partner
SAI, it just isn't going to happen until someone buys me a graphics card.
*****************************************************************************
***** END WHY CHAOS DOESN'T WORK ON A GRAPHICS CARD *****
*****************************************************************************
* AGA DETECTION code added. Now we can display different graphics
depending on if the game is running on AGA or ECS.
Just use IF (AGA) THEN display aga gfx
or IF (ECS) THEN display ecs gfx
* SCREWEY QUIT BUG: Ok, regarding the quit bug that sometimes causes
enforcer hits when we quit the game. I have tracked it down to the
following line of code very near the end:
IF (HiResWindow) CloseWindow(HiResWindow);
I tried adding a HandleIDCMP(DUMP_QUEUE) before that line but it made no
difference.
Now I have copied the CloseWindowSafely() function from the OS 3.0
Includes and Autodocs so the problem is allegedly now fixed.
Nope, I played a test game and I still get the exact same enforcer hits.
* 64 bit alignment of screen memory implemented. This allows the entire
computer to run faster when playing the game on AGA Amigas because the
display will be running at 4x bandwidth.
* DEFAULTS CHANGED to start with 1 human vs 1 computer wizard + 4 generators.
* SCREWEY QUIT BUG FINALLY SOLVED!!!!
Ok, the bug was caused by the fact that when the
CloseWindow(HiResWindow); was executed, at that moment the
HiResRastPort->Layer was == 0;
This could only happen when you played a game then quit it or won and
went back to the main screen then quit the game; which explains why it
never seemed to happen unless you played a "real game".
I had examined this possibility before but there were ONLY 2 lines of
code that changed the value of HiResRastPort->Layer.
1 line disabled the layers and 1 line reenabled them so I thought it was
working 100%. Unfortunately due to the spaghetti code nature these 2
lines were not being executed in pairs.
BTW: sometimes this bug would not cause enforcer hits but would instead
randomly trash a few memory locations. This happened to me dozens of times
when qutting the game would trash a few bytes of my source code in Cygnus
Ed Professional!!
This bug took me 20 hours to fix. :(
ALL FIXED NOW!
* BUG: Vodka has no effect on Independents. NOW FIXED.
* BUG: Agents cast harmful spells against their friends and allies.
Allegedly NOW FIXED.
* BUG: COMPUTER WIZARDS ALWAYS CAST PLASMABEAM STUPIDLY:
NOW FIXED.
* I also modified the PlasmaBeamHandler and stupidity checking to be
compatible with AgentCasting. DONE.
* WROTE a new PlasmaBeamRanking() routine so the computer wizards will try
to cast it under the most favorable circumstances.
* FLAW: PlasmaBeamHandler always converts illegal coordinates into a cell
with GetCell(). NOW FIXED.
* NEW ROUTINES for Plasma Beam AI:
PlasmaBeamStupidity() to check for a stupid PlasmaBeam cast.
PlasmaBeamRanking() to calculate the score for IntelligentComputerSpellSelect()
PlasmaBeamDecideWhichDirection() to calculate the best cell to cast
Plasma Beam on.
PlasmaBeamEvaluate() Low level code used by the Ranking and
DecideWhichDirection routines.
* uhmmm there were major problems in the spellcasting AI...
IsStupidCast() was assuming that the spell was being cast from the
WIZARD's cell thus it couldn't possibly have worked with AgentCasting.
Maybe this explains why agents cast sleep on friendly creatures? NOW FIXED.
PROBLEM: The entire rest of the spellcasting system is always ASSUMING
that spells are cast from the cell of the Wizard rather than from wherever
they are being cast from. I don't see how any spells could work properly
with AgentCasting except for CAST_FREE spells. No spell routines take a
CasterCell parameter. They all take a player parameter and just assume the
caster is at the wizard's location. I never play with AgentCasting so
I'll just leave this for SAI to fix.
* MAJOR BUGs in IntelligentComputerSpellSelect() and other routines.
The following macros were all defective and returned wrong results when
used with magic spells instead of "objects".
IsIDundead, IsIDstatic, IsIDmount, IsIDdragon, IsIDgrowth, IsIDinanimate,
IsIDmeditation, IsIDarcher, IsIDflying, IsIDshooter, IsIDspecialcombat,
IsIDweirdattacker.
This was caused by the game not being a real database.
The computer ranking of spells was all messed up because of these bugs.
NOW FIXED.
* MAJOR BUG in IsStupidCast() All CAST_FREE spells were being handled all
wrong. This was totally messing up the computer's thinking. CAST_FREE
spells were routinely being regarded as REALLY_STUPID(-3) when in fact they
were the best and most usefull spell possible. NOW FIXED.
* Test Plasma Beam. Give a computer wizard some Plasma Beams and some bless
spells and see what he does in various situations. DONE.
* ADDED stupidity checking for Alternography.
* AdjacentCell(cell,number) new predicate which allows us to write loops
for handling all cells adjacent to a particular cell 8x smaller. DONE.
Developer debug filesize is currently 2002684 bytes
* REWROTE the following routines using AdjacentCell(cell,number)
and saved the following amounts from the 68000 release executable:
SpecialCombatHandler() saved 1560 bytes
All 7 adjacency routines in predicate.c saved 5428 bytes
PossibleChoice/ChooseAdjacent saved 360 bytes
GoblinBomb() stuff saved 588 bytes
TOTAL SAVED 7936 bytes
We are saving an additional 2k for each AI routine, such as
PlasmaBeamEvaluate(), that uses the new AdjacentCell() technique.
* DEVELOPER version now generates 020+ code.
* ABOVE 2 changes reduced the developer debug filesize to 1983388
SAVED 19296 bytes!
* INCLUDED spellmanager into the archive.
* ExplorationMode option now on setup screen II.
********** MAJOR BUG IN TerminateChaos() *******************************
BUG: Patrick Hawkins reports: If the talklists file is not present then an
alert is generated telling you it isn't there. Then the whole computer
crashes.
BUG: Kermit reports: If you don't have narrator.device then an alert is
generated saying "Could not open narrator.device" then the whole computer
crashes.
BUG: James Conwell reports: If ANYTHING goes wrong in CommenceChaos(), a
file is not found, a library can't be opened, a device is missing, etc.
then a nice alert is generated telling you such. Then the entire computer
ALWAYS crashes.
ALL FIXED NOW.
****************************************************************************
****************************************************************************
MEMORY LEAKS
****************************************************************************
BUG:
1. Delete the file Devs:narrator.device
2. avail flush
3. run chaos
4. avail flush
5. You will now see that you are missing 40 bytes of fastram. :(
BUG:
1. Put the narrator.device file back into devs:
2. avail flush
3. run chaos
4. quit the game on the main setup screen
5. avail flush
6. You will now see that you are missing 192 bytes of fastram. :(
BUG:
1. Run the game.
2. Quit the game.
3. You will now see that you are missing 240 bytes of fastram. :(
ALL THESE leaks are fixed months later in March, 2000 by JC.
*****************************************************************************
END MEMORY LEAKS
*****************************************************************************
**************************************************************************
***** SEMAPHORE BUGS! *****
**************************************************************************
Anything that changes cellp->id or the Exploration status of
a cell or the global PlayerView MUST be done while holding
the semaphore! Else bad things can (and eventually will) happen!
Also, anything that changes or READS the value of cellp->flag MUST be done
with a lock on the board semaphore!
Otherwise, occassionaly, the variables will exist in a state of
incongruency. This could trigger extremely rare, totally unreproducable,
horrible bugs. This one concept might explain ALL of the bizarre
unreproducable bugs that we've ever had in the past.
* FIXED in core.c: ChangePlayerView(); ClearVisible(); PutToSleep(); WakeUp();
RestoreCell(); BackUp(); BackUpWizard(); RestoreCellWizard();
ExploreCell(); CompletelyRecalculateTeamExplore();
EVERYTHING IN core.c ALLEGEDLY NOW FIXED.
* FIXED in chaos.c: CalculateArtifactOwners();
* FIXED in init.c: InitialisePlayers();
* FIXED in io.c: SaveGame(), LoadGame();
* FIXED in move.c: Combat();
* FIXED spells: No spells needed changing.
Ok, that takes care of all the occurrences of .flag and ->flag and .id and
->id. Now I must search for all forms of code such as:
board[cell]=board[c]
board[newcell] = board[oldcell]
etc. etc. ad infintum.
* FIXED spells: hyperclone, replicate, alliance, separation
* FIXED init.c: initialise_players()
* FIXED io.c: LoadGame()
* FIXED warp.c: WarpOut()
Ok, AFAIK all code which needs a semaphore lock now has it.
The game SHOULD be 100% rock solid now.
**************************************************************************
***** END SEMAPHORE BUGS! *****
**************************************************************************
* PROBLEM: Casting Stone to Flesh or Inanimorphobiosis on a wall gives you
a wall which can be moved but it can't actually attack anything. I changed
it so that it will always be able to attack the living and if the inanimate
object was undead then it will also be able to attack undeads. NOW FIXED.
Since I have now implemented AI for Plasma Beam, this allows me to
implement similar AI for a whole range of new beam spells.
* 11 NEW SPELLS: Brain Drain Beam, Demonic Touch Beam, Combat Drain Beam,
Range Drain Beam, Recover Drain Beam, Lethargy Beam, Paralyzation Beam,
Life Drain Beam, Toxicity Beam, Encumberance Beam, Sluggishness Beam.
These spells do not affect corpses or scrolls. Each spell has its own AI
routine.
* MODIFIED the above spells + PlasmaBeam to do the WHITECIRCLEIM instead of the
WHITECIRCLEEX effect in order to keep in tune with my "WHITECIRCLEIM=BAD,
WHITECIRCLEEX=GOOD" concept. Also made them do the cool EXPLODE effect if
it kills a target. Also put in a delay when a creature is killed by a
beam so that your eye can clearly follow the action and see which creature
was killed.
I cast Toxicity Beam on an enemy wizard so that all his recovery stats are
-1 yet his Combat and Maneuverability are NOT going down to 0 like they are
supposed to.
* BUG! Combat, Maneuverability, Ranged Combat and Special Combat
recovery/poisoning don't work right!!! NOW FIXED.
* The holder of the Sword of Sassenrath makes his nearby friends more
intelligent. DONE.
* PROBLEM: cutting and pasting a wizard in the level editor doesn't
"unexplore" the cells that he has already mapped out.
How do we fix this???
We need an option in the editor to RESET EXPLORATION BITS
this will 0 out all exploration bits and then call ExploreCell(cell) on
EVERY cell. The board will then be properly mapped out. NOW FIXED.
You should use the menu option "ResetExplorationBits" right before you
save the final version of your level. If you don't use this menu option
then there may be various creatures who are standing in unexplored space.
Use this menu option as often as you like. It doesn't hurt anything.
A side effect of this is that SAI's most recent level is now much harder
because there are Independent walls everywhere. Previously these walls
existed in unexplored space and so did most of the board, so the Emerald
Dragon Brigade couldn't see you to shoot at you.
Using this new menu option means that all the Independent walls all over
the board will explore the space around them, meaning they can see pretty
much the entire world. This means the Independent archers can shoot at you
long before you can see them. Ditto for Independent dragons, etc.
I assume this is ok with you. If not then let me know and we can work
something out.
For example if you want to make a level where the independents can't see
everything then you can just make all your passageways be composed of walls
belonging to a nonexistent player or even to NOBODY.
****************************************************************************
Codex Sirconia Upgrade
****************************************************************************
* Several small corrections made.
* Problem: There is no explanation of Summoning, only of Subjugation.
7 new paragraphs added. NOW FIXED.
* Problem: There is no explanation of how the world can exist in a
2-dimensional state and yet flying creatures can "fly" "over" other
objects. 2 paragraphs added. NOW FIXED.
Still need to come up with some sort of explanation for undeads and why
they can't be attacked. ???
* Added 1 more paragraph.
* NEW SECTION: "The Folly of Man" to explain generators. 10 paragraphs.
****************************************************************************
END Codex Sirconia Upgrade
****************************************************************************
****************************************************************************
PassRMB(window) BUG
****************************************************************************
* BUG: I was player 1 and I clicked my archer immediately then immediately
clicked the RMB while it was still saying "wood elf" and things got messed
up. I couldn't move or cancel his move. I had to hit the end turn gadget
to be able to shoot and continue.
OK, I put in some code to PassRMB; GetSpellSelection(); TrapRMB; so now the
entire game should be running with TrapRMB except for the spell-selection
phase. ALLEGEDLY NOW FIXED.
However there is probably still a weird bug because for some reason
the HandleIDCMP() does a PassRMB depending on what type of cell return is
requested. I don't think that is right.
Ok I just played a test game and I was able to click on my wood elf and
bring up the menus every single time! I was able to do the "about" menu
and "new game" menu and "scores" from within the movement phase!!!!
And each time I did it, it messed up the movement of my wood elf.
Something somewhere is doing a PassRMB that isn't supposed to.
Ok I have now removed all occurences of PassRMB() from HandleIDCMP()
and the bug is REALLY NOW FIXED.
If those commented out PassRMB()s mess something up then let me know.
(I don't forsee any problems)
****************************************************************************
END PassRMB(window) BUG
****************************************************************************
* Installed Deluxe Paint 5. + Cracked Gold font + Earth Yellow font
(looks good in a comical/cartoony sort of way)
* Put in all of SAI's new spell graphics into the game.
November 25th, 1999:
INSTALLED Chaos 2.70 on JJ's Amiga 3000.
SENT Chaos 2.70 to SAI for use in level-designing etc.
December 4th, 1999:
* ENFORCER HITS if either of the screens or windows fails to open then
enforcer hits are generated by TerminateChaos(); NOW FIXED.
December 6th, 1999:
* MAJOR RMB BUG FOUND. You can access the menus from within the movement
phase with disastrous results. Furthermore you can't cancel your
spellcasts with the RMB thus the game locks up when you cast a spell but
have no legal targets. I found this while playtesting my 3rd level, I had
just got a Summons spell as a bonus spell for killing a ShapeChanger, so I
was going to _finally_ be able to win. I had 7 open squares adjacent to my
wizard so I cast it immediately. I cast 7 good creatures and then I
couldn't cancel the 8th one! So the game was STUCK! ARRRGH! NOW FIXED.
December 10th, 1999: JJ is complaining about his ally's growths growing
over his creatures. And he isn't allowed to attack the growth and kill it
since its his ally. SAI never stated an opinion on this matter so I am
hereby making a
* NEW RULE: The growths of your allies do not grow over your creatures.
Except for Fire and Flood which still attack EVERYONE as usual.
NOW FIXED.
* Recompiled and redelivered v2.71 for JJ.
* Chaos v2.71 FINALIZED. This is the final OS 1.2 / 1.3 / 2.04 compatible
version of Chaos. All future versions require OS 3.0 or higher.